[Solved] show values of an ed22519 private key stored in OpenSSH format

r.l. Asks: show values of an ed22519 private key stored in OpenSSH format
(note this question uses both ‘openssh’ and ‘openssl’ in the text, I am not confusing the two.)

If I use openssh to general an RSA keypair (ssh-keygen) then I can use ‘openssl rsa -in …’ to view the key parameters (modulus, exponents, primes etc).

If I generate an RSA key but store it using the openssh format (using the -o option to ssh-keygen) I cannot directly read that file by openssl. I first use ssh-keygen -p -f and remove the password. The resulting file is an “RSA PRIVATE KEY”. Then I can proceed in the usual way with openssl to view the parameters.

Using openssl’s ‘ec’ and ‘ecparam’ commands I can generate files and view the parameters that make up EC keys.

If I generate an ed25519 keypair using ssh-keygen -t ed25519 I get a file of the format “OPENSSH PRIVATE KEY”.

Obviously if I use ‘ssh-keygen -p …’ as above on this file I’m never going to get an ‘RSA’ output because its not an RSA key.

So how can I get my “OPENSSH PRIVATE KEY” file generated by ssh-keygen using ed25519 into a format such that I can see the parameters?

openssl EC commands produce files such as “BEGIN EC PARAMETERS” and “BEGIN EC PRIVATE KEY”.

So is there a method to see the ed25519 parameters in the OPENSSH PRIVATE KEY? or a method to turn that file format into one of the EC formats that openssl understands?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.