sshpk-sign(1)

πŸ“¦
version 9.0.0 Β· 3 versions
, in arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– sshpk-sign(1) πŸ’–

okay bestie, welcome to the sshpk manual page for sshpk-sign, part of the sshpk Commands lineup ✨ pull up a chair, we're signing bytes with your SSH key and it's gonna be adorable.


✨ NAME ✨

sshpk-sign β€” sign data using an SSH key πŸ”₯


🌸 SYNOPSYS 🌸

sshpk-sign -i KEYPATH [OPTION...]

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: it takes in arbitrary bytes (yes, any bytes, it's not picky, it's giving "i'll take anything" energy πŸ’…) and signs them using an SSH private key. The key can be literally any type or format that the sshpk library supports β€” including the standard OpenSSH formats, plus PEM PKCS#1 and PKCS#8. iconic honestly πŸ‘‘

The signature gets printed out in Base64 encoding, unless you hand over the --binary or -b option, in which case it's raw bytes, no filter, no makeup, main character energy 😌


πŸŽ€ EXAMPLES πŸŽ€

Signing with default settings:

$ printf 'foo' | sshpk-sign -i ~/.ssh/id_ecdsa
MEUCIAMdLS/vXrrtWFepwe...

Signing in SSH (RFC 4253) format (rather than the default ASN.1):

$ printf 'foo' | sshpk-sign -i ~/.ssh/id_ecdsa -t ssh
AAAAFGVjZHNhLXNoYTIt...

Saving the binary signature to a file:

$ printf 'foo' | sshpk-sign -i ~/.ssh/id_ecdsa \
                            -o signature.bin -b
$ cat signature.bin | base64
MEUCIAMdLS/vXrrtWFepwe...

✨ OPTIONS ✨

  • -v, --verbose β€” spill the tea 🍡 print extra information about the key and signature to stderr while signing.
  • -b, --binary β€” don't base64-encode the signature before outputting it. just raw bytes, no glow-up.
  • -i KEY, --identity=KEY β€” pick the key you're signing with. KEY has to be a relative or absolute filesystem path to the key file. any format the sshpk library supports works, including OpenSSH formats and standard PEM PKCS πŸ—οΈ
  • -f PATH, --file=PATH β€” input file to sign instead of stdin.
  • -o PATH, --out=PATH β€” output file to save the signature in instead of stdout.
  • -H HASH, --hash=HASH β€” set the hash algorithm used for signing. this should be one of sha1, sha256 or sha512. some key types put restrictions on which hash algorithms are allowed (e.g. ED25519 keys can only use SHA-512) 🚨 so don't fight it.
  • -t FORMAT, --format=FORMAT β€” choose the signature format, from asn1, ssh or raw (the raw one is only for ED25519 signatures). asn1 is the default, because that's the format used with TLS and honestly it's the standard in most non-SSH libraries (e.g. OpenSSL). the ssh format is what the SSH protocol uses, and what ssh-agent uses too 🌈

πŸ‘€ SEE ALSO πŸ‘€

sshpk-verify(1)


πŸ’€ BUGS πŸ’€

Report bugs at Github ⟨https://github.com/arekinath/node-sshpk/issues⟩ β€” please and thank you, the maintainers will love you forever 🫢


and that's the whole page bestie, you ate πŸ’… this lil cutie came from sshpk, dated Jan 2016, and it's filed under the name sshpk-sign(1) β€” no cap, that's the whole footer, mwah 😘✨

πŸ“¦ where this page comes from