Closed Kautenja closed 1 year ago
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
ssh-keygen -t ed25519 -m PEM -f jwted25519.key
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