PIV (Personal Identity Verification, the US FIPS 201 standard) turns a multi-protocol security key such as the YubiKey 5 into a smart card. It holds private keys and X.509 certificates, and it is mainly used outside the browser: Windows and domain logon, VPN and Wi-Fi certificates, document and email signing, and code signing. Windows supports it natively; macOS and Linux use it through middleware such as OpenSC.
PIV or FIDO2?
| Need | Use |
|---|---|
| Sign in to websites, Google Workspace, Microsoft 365, Odoo | FIDO2 / passkeys. Simpler, no certificates to issue. |
| Windows logon to an Active Directory domain with an existing PKI | PIV smart card |
| Certificate-based sign-in already required by policy (Microsoft Entra CBA, VPN, government systems) | PIV smart card |
| Signing PDFs, email (S/MIME) or code with a certificate | PIV smart card |
If you have no certificate authority today, start with FIDO2. PIV needs a PKI to issue and revoke certificates, usually Active Directory Certificate Services, and someone who looks after it.
The slots
A PIV key stores keys and certificates in numbered slots, each with a defined purpose:
| Slot | Name | Typical use |
|---|---|---|
| 9A | PIV Authentication | Logging in to the computer or network |
| 9C | Digital Signature | Signing documents, email and code |
| 9D | Key Management | Decrypting email and files |
| 9E | Card Authentication | Physical access, often without a PIN |
| 82 to 95 | Retired keys | Old decryption keys, so older encrypted data stays readable |
On YubiKey 5 firmware 5.7 and later, Yubico lists room for 24 PIV certificates.
Change the defaults before anything else
Every YubiKey ships with the same published PIV values: PIN 123456, PUK 12345678 and a well-known management key. Anyone holding the key can use these until you change them.
- Change the PIN (6 to 8 characters). Users enter it at logon.
- Change the PUK. It unblocks a PIN after too many wrong attempts. Keep it with the administrator, not on a sticky note.
- Change the management key. It controls key generation and certificate loading.
ykmancan generate a random one and store it on the key, protected by the PIN.
With Yubico’s command-line tool:
ykman piv access change-pin
ykman piv access change-puk
ykman piv access change-management-key --generate --protect
On Windows, if the Yubico smart card minidriver sees a default management key and PUK the first time a key is used, it replaces the management key and blocks the PUK. Set a PUK yourself first if you want users to be able to recover from a blocked PIN.
If both PIN and PUK are blocked, or the management key is lost, the only way back is a reset of the PIV function, which deletes its keys and certificates.
A safe rollout order
- Confirm your certificate authority can issue smart card logon certificates, and that revocation (CRL or OCSP) works from every site.
- Generate keys on the security key (slot 9A), so the private key never exists anywhere else, and issue the certificate to it.
- Issue two keys per administrator, as with FIDO2.
- Pilot with IT staff before enforcing “smart card required” on any account. Keep a break-glass account that does not depend on the PKI.
- Write down the reset process: who can unblock a PIN with the PUK, and how a lost key’s certificate is revoked.
Related
- Choosing a YubiKey: PIV needs a multi-protocol model, not a FIDO2-only Security Key.
- Security keys for Google Workspace and Microsoft 365: the FIDO2 route for cloud accounts.
- SSH and Git signing with a security key: FIDO2-based SSH keys need no PKI.