-
Notifications
You must be signed in to change notification settings - Fork 168
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 3: Can't construct RSA keys from any available serializable key data #679
Comments
What is
This is weird. |
I apologize, I failed to include some code. I will add it back. IE -
|
I did build the gem from |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There appears to be no way to construct a key from any parameters. This has come up in several other issues, but the approaches that have been said to work don't seem to actually work.
I tried to use an approach adapted from Pushpad referenced in this issue comment (and others elsewhere), but didn't have any luck, and I'm trying to work with RSA keys specifically.
For all the below code:
foo = OpenSSL::PKey::RSA.new(2048)
Approach adapted from COSE referenced in this issue comment:
Even just using the BNs that exist on the just-generated key without stringifying and creating new BNs doesn't work:
Constructing a public key seems fine:
The der output of the key and the manually constructed sequence also match:
If I take the serialized der output of the key and attempt to read it in in an environment using OpenSSL 1.1.1, that works and the key is intact:
These are some other simpler things I tried, just for reference:
Encryption/decryption via the openssl cli works fine with the generated pems, but I can't find any mechanism using any of the serializable data to instantiate a private key to do anything in Ruby. Is there a good reason why #555 can't be merged if it's working? Do you see any problems with how I've implemented the solutions that have been proposed before, or have the required approaches changed?
The text was updated successfully, but these errors were encountered: