.TH "SSHPK\-SIGN" "" "October 2018" "" "" .SH "NAME" \fBsshpk-sign\fR .SH NAME .P sshpk\-sign \- sign data using an SSH key .SH SYNOPSYS .P \fBsshpk\-sign\fP \-i KEYPATH [OPTION\.\.\.] .SH DESCRIPTION .P Takes in arbitrary bytes, and signs them using an SSH private key\. The key can be of any type or format supported by the \fBsshpk\fP library, including the standard OpenSSH formats, as well as PEM PKCS#1 and PKCS#8\. .P The signature is printed out in Base64 encoding, unless the \fB\-\-binary\fP or \fB\-b\fP option is given\. .SH EXAMPLES .P Signing with default settings: .P .RS 2 .nf $ printf 'foo' | sshpk\-sign \-i ~/\.ssh/id_ecdsa MEUCIAMdLS/vXrrtWFepwe\.\.\. .fi .RE .P Signing in SSH (RFC 4253) format (rather than the default ASN\.1): .P .RS 2 .nf $ printf 'foo' | sshpk\-sign \-i ~/\.ssh/id_ecdsa \-t ssh AAAAFGVjZHNhLXNoYTIt\.\.\. .fi .RE .P Saving the binary signature to a file: .P .RS 2 .nf $ printf 'foo' | sshpk\-sign \-i ~/\.ssh/id_ecdsa \\ \-o signature\.bin \-b $ cat signature\.bin | base64 MEUCIAMdLS/vXrrtWFepwe\.\.\. .fi .RE .SH OPTIONS .P \fB\-v, \-\-verbose\fP Print extra information about the key and signature to stderr when signing\. .P \fB\-b, \-\-binary\fP Don't base64\-encode the signature before outputting it\. .P \fB\-i KEY, \-\-identity=KEY\fP Select the key to be used for signing\. \fBKEY\fP must be a relative or absolute filesystem path to the key file\. Any format supported by the \fBsshpk\fP library is supported, including OpenSSH formats and standard PEM PKCS\. .P \fB\-f PATH, \-\-file=PATH\fP Input file to sign instead of stdin\. .P \fB\-o PATH, \-\-out=PATH\fP Output file to save signature in instead of stdout\. .P \fB\-H HASH, \-\-hash=HASH\fP Set the hash algorithm to be used for signing\. This should be one of \fBsha1\fP, \fBsha256\fP or \fBsha512\fP\|\. Some key types may place restrictions on which hash algorithms may be used (e\.g\. ED25519 keys can only use SHA\-512)\. .P \fB\-t FORMAT, \-\-format=FORMAT\fP Choose the signature format to use, from \fBasn1\fP, \fBssh\fP or \fBraw\fP (only for ED25519 signatures)\. The \fBasn1\fP format is the default, as it is the format used with TLS and typically the standard in most non\-SSH libraries (e\.g\. OpenSSL)\. The \fBssh\fP format is used in the SSH protocol and by the ssh\-agent\. .SH SEE ALSO .P sshpk\-verify(1) .SH BUGS .P Report bugs at Github \fIhttps://github\.com/arekinath/node\-sshpk/issues\fR