Extract public key from pem and convert to ssh-RSA format

Posted on Fri 12 May 2017 in openssl

In order to extract public key from pem and convert to ssh-RSA format, perform following commands

$ openssl rsa -in PUBLICKEY.pem -pubout > PUBLICKEY.pub
$ ssh-keygen -f PUBLICKEY.pub -i -m PKCS8