Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSSL::PKey::RSA missing #public_to_der #298

Open
segiddins opened this issue Apr 30, 2024 · 1 comment
Open

OpenSSL::PKey::RSA missing #public_to_der #298

segiddins opened this issue Apr 30, 2024 · 1 comment

Comments

@segiddins
Copy link

#!/usr/bin/env ruby

require 'rubygems'
require 'openssl'

b64 = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2G2Y+2tabdTV5BcGiBIx0a9fAFwrkBbmLSGtks4L3qX6yYY0zufBnhC8Ur/iy55GhWP/9A/bY2LhC30M9+RYtw=="

key = OpenSSL::PKey.read(b64.unpack1("m"))

pp OpenSSL::Digest::SHA256.hexdigest(key.public_to_der)

passes on MRI, fails on jruby (JRuby-OpenSSL 0.14.5):

NoMethodError: undefined method `public_to_der' for #<OpenSSL::PKey::RSA:0x5a1c7619>
  <main> at Untitled 2.rb:10
@segiddins
Copy link
Author

So is OpenSSL::PKey::EC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant