I'd like to convert an existing public key (generated using ssh-keygen
) from PEM
-format to DER
-format
I tried:
openssl rsa -in ~/.ssh/id_rsa.pub -inform PEM -pubin -outform DER -out ~/.ssh/id_rsa.pub.der
Unfortunately this gives the following error:
unable to load Public Key
139946985690784:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: PUBLIC KEY
The file ~/.ssh/id_rsa.pub
contains a public key; cat ~/.ssh/id_rsa.pub
gives:
ssh-rsa ...... user@machine
What am I doing wrong?