This article covers the two options for resetting the OpenPGP application on your YubiKey.
Warning: This will permanently delete any PGP keys you have on the YubiKey.
Option 1 - Reset Using YubiKey Manager
- Download and install YubiKey Manager.
- Insert the YubiKey into a USB port.
- Open Command Prompt (Windows) or Terminal (Mac / Linux).
- Type ykman openpgp reset and press Enter.
- When prompted, press Y and then Enter to confirm the reset.
Note: If you receive an error about not being able to find the program ykman, you will need to use cd to navigate to the folder it is in before running the ykman command.
- For Windows you would run cd "C:\Program Files\Yubico\YubiKey Manager"
- For Mac you would run cd /Applications/YubiKey\ Manager.app/Contents/MacOS/
Option 2 - Manual Reset Using GPG
- Insert the YubiKey into a USB port.
- Open Command Prompt (Windows Users) or Terminal (Mac / Linux).
- To check the PIN/Admin PIN reset status, enter the GPG command: gpg --card-status. If you receive the response "gpg --card-status" fails, terminate gpg-agent and gpg-connect-agent processes, then try again, or you can reboot.
- Run gpg-connect-agent --hex
- If PIN retry counter from step 2 is greater than 0, enter the command: scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
- Repeat the above command until one of the following occurs:
- YubiKey 4/5 Series device reports "D[0000] 69 83"
- YubiKey NEO device reports "D[0000] 63 C0"
- If Admin PIN retry counter is greater than 0, enter the GPG command: scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
- Repeat the above command until one of the following occurs:
- YubiKey 4/5 Series device reports "D[0000] 69 83"
- YubiKey NEO device reports "D[0000] 63 C0"
- To terminate card, run the GPG command: scd apdu 00 e6 00 00 You should see "D[0000] 90 00" (if already terminated, you should receive "D[0000] 69 85").
- To reactive card, run the GPG command: scd apdu 00 44 00 00 You should see "D[0000] 90 00" (if card hasn't been terminated, you should receive "D[0000] 69 85").
- Close or exit the command prompt or terminal window, and then remove and re-inser the YubiKey device.
- Terminate gpg-agent and gpg-connect-agent processes (or restart), then run the GPG command: gpg --card-status
- Confirm the PIN Retry counter is as follows:
- "3 0 3" on a a YubiKey 4/5 Series device
- "3 3 3" on a YubiKey NEO device