I'm having trouble understanding how to use the openssl tool to convert rsa public keys.
This works fine for a private key
$ openssl rsa -in id_rsa -pubout -outform DER > out writing RSA key
If I only have a public key, I thought I'd be able to do the same and just add "-pubin". But I get a cryptic error complaining it was expecting a public key ... but that is what I gave it.
$ openssl rsa -pubin -in id_rsa.pub -pubout -outform DER > out unable to load Public Key 140028314654360:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:701:Expecting: PUBLIC KEY
In case I was supposed to use pkey instead I tried that and I still get that error, but without the second line
$ openssl pkey -pubin -in id_rsa.pub -pubout -outform DER > out unable to load Public Key