Convert openSSH public key format to PEM

Form the command line you can run
ssh-keygen -f ~/.ssh/id_rsa -m 'PEM' -e > public.pem
in order to export your openssh public key to a PEM file, but doing in so in javascript is not too difficult and doesn't require the webcrypto API, only a bit of ASN.1 knowledge.

Again Converting open ssh public key proves to be invaluable to come up with the tight conversion

Result can be check with openssl asn.1 decoder
openssl asn1parse -i -in public.pem


No data is being sent to the server, everything happens within the context of this web page.
Tweet




Made with by Patrick Roumanoff Fork me on GitHub