-
-
Notifications
You must be signed in to change notification settings - Fork 260
failed to load key: bio read failed #241
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
Comments
ed25519 is based on elliptic curves, whereas rsa is based on prime factorization. The key types differ, meaning you can't use an rsa key with ed25519 (or really any other algorithm except pss* which is based on rsa). You need to generate a new key suitable for elliptic curves. |
Ah I see. I suppose my issue then is how are these ed25519 keys supposed to be generated? The key was generated using the following which should produce an ed25519 key as far as I can tell
|
I should mention the key in the example code was generated using the above command; it's not the RSA key from the original code. |
Should be this https://stackoverflow.com/a/73118582 |
Cryptography libraries are not as interchangeable as we'd like... never tried ssh but I assume it's adding something special to know which alg to use |
Oh interesting, I was unaware of that. You're totally right, the keys generated by OpenSSL 3 do work in this example and look much more like the keys that I was seeing in the test cases. Thanks for the help! |
What happened?
ed25519 does not work in place of rsa in example code; instead it yields the exception:
The same is true for attempting to load public keys in my experience.
How To Reproduce?
Version
0.6.0
What OS are you seeing the problem on?
MacOS
What compiler are you seeing the problem on?
GCC
Relevant log output
The output of the standard example for RSA works as expected. Swapping out rsa for ed25519 fails with a newly generated key-pair
Code of Conduct
The text was updated successfully, but these errors were encountered: