STRONGSWAN_PKI---KEYID(1)
β¨ 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 fromSTDINinstead. main character energy π«Ά-x,--keyid hexβ a Smartcard or TPM private key object handle, in hex format, with an optional0xprefix. yes the prefix is optional, we're flexible π-t,--type typeβ type of input. one ofpriv(private key),rsa(RSA private key),ecdsa(ECDSA private key),pub(public key),pkcs10(PKCS#10 certificate request),x509(X.509 certificate). defaults topriv. π-I,--id id-typeβ type of identifier. one ofall(all identifiers),spk(SHA-1 hash of subjectPublicKey),spki(SHA-1 hash of subjectPublicKeyInfo). defaults toall. π-f,--format formatβ output format. one ofpretty(user-readable output),hex(hexadecimal encoding),base64(Base64 encoding),bin(raw binary data). defaults topretty. π
π¦ 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 thePKI --KEYID(1)header, in thestrongSwanmanual. 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
- fedora 43: strongswan 6.0.7-2.fc43 Β· GPL-2.0-or-later
- fedora 44: strongswan 6.0.7-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms