YUBICO-PIV-TOOL(1)
π NAME π
okay so hi bestie, this is YUBICO-PIV-TOOL(1), and it is the tool for managing Personal Identity Verification credentials on Yubikeys. that's it. that's the job. PIV creds, on your YubiKey, handled. π
it lives in the User Commands part of the manual, which is exactly the energy it deserves. periodt.
π¦ SYNOPSIS π¦
yubico-piv-tool [OPTION]...
likeβ¦ that's it. options. go off. π
πΈ DESCRIPTION πΈ
so the whole description is the options, bestie β this tool is a bunch of flags that each do a thing, and you stack them. here's the full roster, no skips, no cuts, no "we'll get to it later". we never do that here. π«Ά
-h,--helpβ print help and dip out. classic. β¨--full-helpβ print help but this time it includes the hidden options too, then exit. the secret menu, iykyk. π-V,--versionβ print the version and exit.-v,--verbose[=INT]β print more info. the default is0.-r,--reader=STRINGβ only use a matching reader. default isYubikey.-k,--key[=STRING]β the management key to use. if you don't give a value, it will ask for the key. default is010203040506070801020304050607080102030405060708.-a,--action=ENUMβ the action to take. possible values are"version","generate","set-mgm-key","reset","pin-retries","import-key","import-certificate","set-chuid","request-certificate","verify-pin","verify-bio","change-pin","change-puk","unblock-pin","selfsign-certificate","delete-certificate","read-certificate","read-public-key","status","test-signature","test-decipher","list-readers","set-ccc","write-object","read-object","attest","move-key","delete-key".
and here's the part that goes so hard: you can give multiple actions at once and they'll be executed in order. for example:
--action=verify-pin --action=request-certificate
chef's kiss. the pipeline of it all. π
-s,--slot=ENUMβ what key slot to operate on. possible values are"9a","9c","9d","9e","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","f9".
so like, what does each one even mean:
9ais for PIV Authentication9cis for Digital Signature (PIN always checked)9dis for Key Management9eis for Card Authentication (PIN never checked)82-95is for Retired Key Managementf9is for Attestation
thank you for coming to my ted talk. π
--to-slot=ENUMβ what slot to move an existing key to. same possible values:"9a","9c","9d","9e","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","f9".
and again, for the people in the back:
9ais for PIV Authentication9cis for Digital Signature (PIN always checked)9dis for Key Management9eis for Card Authentication (PIN never checked)82-95is for Retired Key Managementf9is for Attestation
-A,--algorithm=ENUMβ what algorithm to use. possible values are"RSA1024","RSA2048","RSA3072","RSA4096","ECCP256","ECCP384","ED25519","X25519". default isRSA2048.-H,--hash=ENUMβ the hash to use for signatures. possible values are"SHA1","SHA256","SHA384","SHA512". default isSHA256.-n,--new-key=STRINGβ the new management key to use for theset-mgm-keyaction. if you skip it, it will ask for the key.--pin-retries=INTβ how many retries before the pin code is blocked. (bestie. be careful with this one, fr fr. π₯)--puk-retries=INTβ how many retries before the puk code is blocked.-i,--input=STRINGβ filename to use as input.-means stdin. default is-.-o,--output=STRINGβ filename to use as output.-means stdout. default is-.-K,--key-format=ENUMβ the format of the key being read/written. possible values are"PEM","PKCS12","GZIP","DER","SSH". default isPEM.--compressβ compress a large certificate using GZIP before importing it. default is off. ποΈ--globalβ reset the whole device, across all applications. default is off. (this is the big red button energy, ngl. π)-p,--password=STRINGβ password for decryption of the private key file. if you skip it, the password will be asked for.-S,--subject=STRINGβ the subject to use for the certificate request.
and the subject has to be written exactly like this:
/CN=host.example.com/OU=test/O=example.com/
format girlies, we respect them. β¨
--serial=INTβ the serial number of the self-signed certificate.--valid-days=INTβ how long (in days) until the self-signed certificate expires. default is365.-P,--pin=STRINGβ pin/puk code for verification. if you skip it, the pin/puk will be asked for.-N,--new-pin=STRINGβ new pin/puk code for changing. if you skip it, the pin/puk will be asked for.--pin-policy=ENUMβ set the pin policy for thegenerateorimport-keyaction. only available on YubiKey 4 or newer. possible values are"never","once","always","matchonce","matchalways".--touch-policy=ENUMβ set the touch policy for thegenerate,import-keyorset-mgm-keyaction. only available on YubiKey 4 or newer. possible values are"never","always","cached".--id=INTβ the id of the object for write/read object. πͺͺ-f,--format=ENUMβ the format of the data for write/read object. possible values are"hex","base64","binary". default ishex.--attestationβ add attestation cross-signature. default is off.-m,--new-key-algo=ENUMβ new management key algorithm to use for theset-mgm-keyaction. possible values are"TDES","AES128","AES192","AES256". default isTDES.--scp11β communication with the YubiKey is done over an encrypted channel. default is off.
DEPRECATED! please use the --enc flag instead. it's giving "we've moved on, bestie". π«Ά
--encβ communication with the YubiKey is done over an encrypted channel. default is off. π
and that's the whole page, no crumbs left behind. this was yubico-piv-tool version 2.7.3, dated January 2026, and honestly? she ate. π β¨ go manage those PIV credentials, bestie, you've got this. ππ
π¦ where this page comes from
- alpine 3.24: yubico-piv-tool-doc 2.7.3-r0 Β· BSD-2-Clause
- arch rolling: yubico-piv-tool 2.7.3-1 Β· BSD-2-Clause
- fedora 44: yubico-piv-tool 2.7.3-1.fc44 Β· BSD-2-Clause
- fedora 44: yubico-piv-tool 2.7.3-1.fc44 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms