Skip to content

Instantly share code, notes, and snippets.

@tnarayan
tnarayan / sshpub-to-rsa
Created April 24, 2012 13:37 — forked from mahmoudimus/sshpub-to-rsa
converts an openssh RSA public key into a format usable by openssl rsautl (if you don't have openssh 5.6 or later with ssh-keygen PEM export format)
#!/usr/bin/env python
# with help and inspiration from
# * ASN1_generate_nconf(3) (specifically the SubjectPublicKeyInfo structure)
# * http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG%2C-OpenSsh-and-OpenSSL
# * http://blog.oddbit.com/2011/05/converting-openssh-public-keys.html
# the unix way of doing it:
# Convert ssh-rsa key to pem
# ssh-keygen -f infile.pub -e -m PKCS8 > outfile.pem
@mahmoudimus
mahmoudimus / sshpub-to-rsa
Created January 21, 2012 22:19 — forked from thwarted/sshpub-to-rsa
converts an openssh RSA public key into a format usable by openssl rsautl (if you don't have openssh 5.6 or later with ssh-keygen PEM export format)
#!/usr/bin/env python
# with help and inspiration from
# * ASN1_generate_nconf(3) (specifically the SubjectPublicKeyInfo structure)
# * http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG%2C-OpenSsh-and-OpenSSL
# * http://blog.oddbit.com/2011/05/converting-openssh-public-keys.html
# the unix way of doing it:
# Convert ssh-rsa key to pem
# ssh-keygen -f infile.pub -e -m PKCS8 > outfile.pem