To work with ECDSA keys I am using the python-ecdsa library. Unfortunately this library can not process keyfiles properly if they are provided in the OpenSSH format. Instead I generate them in the PEM format, which the library can handle, using the following command:
ssh-keygen -t ecdsa -b 256 -f /home/user/Documents/ECDSA/key -m pem
However, while I am able to work with the keyfiles in PEM just fine, I do need them in the OpenSSH format in the end. The following ideas come to mind:
- Generate them in the OpenSSH format and convert them to the PEM format.
- Generate them in the PEM format and convert them to the OpenSSH format.
- Generate them in both formats in one go?
Is any of these options possible? I am aware one can convert formats when the type is RSA like so:
ssh-keygen -f id_rsa.pub -m 'PEM' -e > public.pem
However for ECDSA that is not possible:
do_convert_to_pem: unsupported key type ECDSA
What options do I have?