Key Delete

yubico-piv-tool -a delete-key -s <slot> -k

Description

Deletes a key from the specified PIV slot.

Note
This actions deletes only the key, not the certificate. So if the slot already stores a certificate, it might still look populated even if the key is no longer there.

Deleting a key is an action that requires authentication, which is done by providing the management key. If no management key is provided, the tool will try to authenticate using the default management key.
[It is strongly recommended to change the Yubikey’s PIN, PUK and management key before start using it.]

Parameters

Parameter

Required

Optional

Description

Possible values

Default value

-s, --slot

X

What key slot to delete the key from

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

-k, --key

X

Management key to use, if no value is specified key will be asked for

010203040506070801020304050607080102030405060708

Examples

yubico-piv-tool -a delete-key -s 9c -k
Enter Password:
Enter management key:
Successfully deleted key.