Open segiddins opened 6 months ago
#!/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
So is OpenSSL::PKey::EC
OpenSSL::PKey::EC
passes on MRI, fails on jruby (JRuby-OpenSSL 0.14.5):