Question about key file formats used by OpenSSH

Elvis Stansvik elvstone at gmail.com
Tue Feb 3 01:04:54 EST 2009


Hello OpenSSH developers, first post.

I'm implementing SSH agent functionality in a program of mine, with
the ability to add/remove keys files as saved by OpenSSH. So I'm
trying to figure out which formats OpenSSH uses natively for the
different types of keys. The only specification related to SSH key
file formats I've found is RFC4716 (SSH Public Key File Format).

Analysis of ssh-keygen output with varying key types shows the
following four formats for which I haven't found any specification:

 * Something similar to RFC4716 and RFC1421, but not quite the same.
    Used by OpenSSH for version 2 DSA and RSA private keys.

 * "ssh-dss|rsa-dss [base64?] comment".
    Used by OpenSSH for version 2 DSA and RSA public keys.

 * "[keysize?] [decimal number] [more decimal numbers]".
    Used by OpenSSH for version 1 RSA public keys.

  * ASCII header line followed by binary data.
    Used by OpenSSH for version 1 RSA private keys.

Are these formats specified somewhere, short of reading OpenSSH source
code? Why not use RFC4716 natively?

Best regards,
Elvis Stansvik


More information about the openssh-unix-dev mailing list