STRONGSWAN_PKI---KEYID(1)

πŸ“¦
version 6.0.7 Β· 4 versions
, in fedora 43, fedora 44

✨ pki --keyid ✨

okay bestie, listen up πŸ’– this is a strongSwan manual page, and we're talking about pki --keyid β€” the little sub-command that calculates key identifiers for a key or a certificate. yes, those long hex blobs you keep squinting at. it's giving "cryptographic fingerprint reveal" and honestly? iconic. πŸ‘‘


🌸 NAME 🌸

pki --keyid β€” calculate key identifiers of a key or certificate πŸ¦‹


✨ SYNOPSIS ✨

pki --keyid [--in file|--keyid hex] [--type type] [--id id-type]
            [--format format] [--debug level]

pki --keyid --options file

pki --keyid -h | --help

πŸ’œ DESCRIPTION πŸ’œ

so this is a sub-command of pki(1), right? and what it does is calculate key identifiers of private keys and certificates. that's the whole vibe. short king. periodt. πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • -h, --help β€” prints usage info plus a lil summary of all the options you got. your cheat sheet fr fr πŸ“‹
  • -v, --debug level β€” sets the debug level. default: 1. ✨
  • -+, --options file β€” reads command line options straight outta file. no cap, it just slurps them up πŸ₯€
  • -i, --in file β€” the input file. and if you don't give one? it reads the input from STDIN instead. main character energy 🫢
  • -x, --keyid hex β€” a Smartcard or TPM private key object handle, in hex format, with an optional 0x prefix. yes the prefix is optional, we're flexible πŸ’–
  • -t, --type type β€” type of input. one of priv (private key), rsa (RSA private key), ecdsa (ECDSA private key), pub (public key), pkcs10 (PKCS#10 certificate request), x509 (X.509 certificate). defaults to priv. 🌈
  • -I, --id id-type β€” type of identifier. one of all (all identifiers), spk (SHA-1 hash of subjectPublicKey), spki (SHA-1 hash of subjectPublicKeyInfo). defaults to all. πŸ‘‘
  • -f, --format format β€” output format. one of pretty (user-readable output), hex (hexadecimal encoding), base64 (Base64 encoding), bin (raw binary data). defaults to pretty. πŸ’…

πŸ¦‹ EXAMPLES πŸ¦‹

okay now the fun part, let's actually do stuff. πŸ“

Calculate key identifiers of an RSA private key:

$ pki --keyid --in key.der
subjkey (SHA-1 of subjectPublicKey):
             6a:9c:74:d1:f8:89:79:89:f6:5a:94:e9:89:f1...
keyid (SHA-1 of subjectPublicKeyInfo):
             6e:55:dc:7e:9c:a5:58:d9:5b:e3:c7:13:14:e1...

Calculate key identifiers of an X.509 certificate:

$ pki --keyid --in cert.der --type x509
subjkey (SHA-1 of subjectPublicKey):
             6a:9c:74:d1:f8:89:79:89:f6:5a:94:e9:89:f1...
keyid (SHA-1 of subjectPublicKeyInfo):
             6e:55:dc:7e:9c:a5:58:d9:5b:e3:c7:13:14:e1...

Calculate keyid in simple hex encoding of an X.509 certificate:

$ pki --keyid --in cert.der --type x509 --id spki --format hex
6e55dc7e9ca558d95be3c71314e1...

look at those beautiful hashes. no colons, no spaces, just pure hex. ate. πŸ”₯


🌈 SEE ALSO 🌈


lowkey reminder: this whole page lives under the PKI --KEYID(1) header, in the strongSwan manual. iykyk 🧚

and that's a wrap, bestie πŸ’– this was version 6.0.7, dated 2019-04-29, brought to you by the strongSwan girlies. go forth and identify those keys. slay. πŸ‘‘βœ¨

πŸ“¦ where this page comes from