| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 | .TH sshpk\-conv 1 "Jan 2016" sshpk "sshpk Commands".SH NAME.PPsshpk\-conv \- convert between key formats.SH SYNOPSYS.PP\fB\fCsshpk\-conv\fR \-t FORMAT [FILENAME] [OPTIONS...].PP\fB\fCsshpk\-conv\fR \-i [FILENAME] [OPTIONS...].SH DESCRIPTION.PPReads in a public or private key and converts it between different formats,particularly formats used in the SSH protocol and the well\-known PEM PKCS#1/7formats..PPIn the second form, with the \fB\fC\-i\fR option given, identifies a key and prints to stderr information about its nature, size and fingerprint..SH EXAMPLES.PPAssume the following SSH\-format public key in \fB\fCid_ecdsa.pub\fR:.PP.RS.nfecdsa\-sha2\-nistp256 AAAAE2VjZHNhLXNoYTI...9M/4c4= user@host.fi.RE.PPIdentify it with \fB\fC\-i\fR:.PP.RS.nf$ sshpk\-conv \-i id_ecdsa.pubid_ecdsa: a 256 bit ECDSA public keyECDSA curve: nistp256Comment: user@hostFingerprint:  SHA256:vCNX7eUkdvqqW0m4PoxQAZRv+CM4P4fS8+CbliAvS4k  81:ad:d5:57:e5:6f:7d:a2:93:79:56:af:d7:c0:38:51.fi.RE.PPConvert it to \fB\fCpkcs8\fR format, for use with e.g. OpenSSL:.PP.RS.nf$ sshpk\-conv \-t pkcs8 id_ecdsa\-\-\-\-\-BEGIN PUBLIC KEY\-\-\-\-\-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAsA4R6N6AS3gzaPBeLjG2ObSgUsRzOt+kWJoijLnw3ZMYUKmAx+lD0I5XUxdrPcs1vH5f3cn9TvRvO9L0z/hzg==\-\-\-\-\-END PUBLIC KEY\-\-\-\-\-.fi.RE.PPRetrieve the public half of a private key:.PP.RS.nf$ openssl genrsa 2048 | sshpk\-conv \-t ssh \-c foo@barssh\-rsa AAAAB3NzaC1yc2EAAA...koK7 foo@bar.fi.RE.PPConvert a private key to PKCS#1 (OpenSSL) format from a new\-style OpenSSH keyformat (the \fB\fCssh\-keygen \-o\fR format):.PP.RS.nf$ ssh\-keygen \-o \-f foobar\&...$ sshpk\-conv \-p \-t pkcs1 foobar\-\-\-\-\-BEGIN RSA PRIVATE KEY\-\-\-\-\-MIIDpAIBAAKCAQEA6T/GYJndb1TRH3+NL....\-\-\-\-\-END RSA PRIVATE KEY\-\-\-\-\-.fi.RE.SH OPTIONS.TP\fB\fC\-i, \-\-identify\fRInstead of converting the key, output identifying information about it to stderr, including its type, size and fingerprints..TP\fB\fC\-p, \-\-private\fRTreat the key as a private key instead of a public key (the default). If yousupply \fB\fCsshpk\-conv\fR with a private key and do not give this option, it willextract only the public half of the key from it and work with that..TP\fB\fC\-f PATH, \-\-file=PATH\fRInput file to take the key from instead of stdin. If a filename is suppliedas a positional argument, it is equivalent to using this option..TP\fB\fC\-o PATH, \-\-out=PATH\fROutput file name to use instead of stdout..PP\fB\fC\-T FORMAT, \-\-informat=FORMAT\fR.TP\fB\fC\-t FORMAT, \-\-outformat=FORMAT\fRSelects the input and output formats to be used (see FORMATS, below)..TP\fB\fC\-c TEXT, \-\-comment=TEXT\fRSets the key comment for the output file, if supported..SH FORMATS.PPCurrently supported formats:.TP\fB\fCpem, pkcs1\fRThe standard PEM format used by older OpenSSH and most TLS libraries such asOpenSSL. The classic \fB\fCid_rsa\fR file is usually in this format. It is an ASN.1encoded structure, base64\-encoded and placed between PEM headers..TP\fB\fCssh\fRThe SSH public key text format (the format of an \fB\fCid_rsa.pub\fR file). A singleline, containing 3 space separated parts: the key type, key body and optionalkey comment..TP\fB\fCpkcs8\fRA newer PEM format, usually used only for public keys by TLS libraries suchas OpenSSL. The ASN.1 structure is more generic than that of \fB\fCpkcs1\fR\&..TP\fB\fCopenssh\fRThe new \fB\fCssh\-keygen \-o\fR format from OpenSSH. This can be mistaken for a PEMencoding but is actually an OpenSSH internal format..TP\fB\fCrfc4253\fRThe internal binary format of keys when sent over the wire in the SSHprotocol. This is also the format that the \fB\fCssh\-agent\fR uses in its protocol..SH SEE ALSO.PP.BR ssh-keygen (1), .BR openssl (1).SH BUGS.PPEncrypted (password\-protected) keys are not supported..PPReport bugs at Github\[la]https://github.com/arekinath/node-sshpk/issues\[ra]
 |