The SCARD_W_SECURITY_VIOLATION (0x8010006A) error indicates that the YubiKey Smart Card Minidriver was not able to authenticate to the YubiKey to perform an enrollment action such as generating or importing a private key. This generally happens when the management key on the YubiKey PIV (smart card) applet was changed from the default using the PIV Manager, yubico-piv-tool, or another 3rd party utility. To set it back to the default, you can use the instructions below.
If You Do Not Know the Management Key
If you do not know the management key, you must reset the PIV applet. This will reset the management key to the default and then the minidriver will be able to authenticate to the YubiKey.
If You Know the Management Key
If you know what the management key was changed to, you can use it to change it back to the default. After setting it to the default, the minidriver will be able to authenticate to the YubiKey.
- Download and install the YubiKey Manager software.
- Open Command Prompt.
- Run: ykman piv change-management-key -m <MGMKEY> -n 010203040506070801020304050607080102030405060708
Where <MGMKEY> is the management key you have set.
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 example, you would run cd "C:\Program Files\Yubico\YubiKey Manager".