You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenSSL::PKey::EC#to_pem or .new appears to change EC keys created by CRuby's openssl #257
not sure about whether the format is expected to be "byte level" same between C-OpenSSL and Java's Bouncy-Castle...
as long as one is able to parse other's PEM encoded format and end up with the same object.
The PEM exported by jruby-openssl appears to be much shorter than the PEM exported by CRuby's openssl.
was due 401749e which explicitly skipped the public part when encoding the private key
I think the main problem is that it's not possible to instantiate an OpenSSL::PKey::EC object from the PEM format it generates itself:
irb(main):002:0> ec = OpenSSL::PKey::EC.generate("prime256v1")
=> #<OpenSSL::PKey::EC:0x21f7e537>
irb(main):003:0> OpenSSL::PKey::EC.new(ec.to_pem)
org/jruby/ext/openssl/PKeyEC.java:356:in `initialize': Neither PUB key nor PRIV key: (OpenSSL::PKey::ECError)
from org/jruby/RubyClass.java:923:in `new'
from (irb):3:in `evaluate'
from org/jruby/RubyKernel.java:1277:in `eval'
from org/jruby/RubyKernel.java:1725:in `loop'
from org/jruby/RubyKernel.java:1426:in `catch'
from org/jruby/RubyKernel.java:1426:in `catch'
from /usr/bin/jirb:13:in `<main>'
Activity
kares commentedon Apr 11, 2024
not sure about whether the format is expected to be "byte level" same between C-OpenSSL and Java's Bouncy-Castle...
as long as one is able to parse other's PEM encoded format and end up with the same object.
was due 401749e which explicitly skipped the public part when encoding the private key
jcharaoui commentedon Jan 17, 2026
I think the main problem is that it's not possible to instantiate an
OpenSSL::PKey::ECobject from the PEM format it generates itself:This works without issues with MRI.