Show / Hide Table of Contents

DeleteKey Method

DeleteKey(byte)

Deletes/clears any key at a given PivSlot.

C#
public void DeleteKey(byte slotToClear)

Parameters

Type Name Description
byte slotToClear

The Yubikey slot of the key you want to clear. This must be a valid slot number.

Exceptions

Type Condition
InvalidOperationException

Either the call to the Yubikey was unsuccessful or there wasn't any KeyCollector loaded, the key provided was not a valid Triple-DES key, or the YubiKey had some other error, such as unreliable connection. Refer to the specific exception message.

MalformedYubiKeyResponseException

The YubiKey returned malformed data and authentication, either single or double, could not be performed.

OperationCanceledException

The user canceled management key collection.

SecurityException

Mutual authentication was performed and the YubiKey was not authenticated.

NotSupportedException

Thrown when the Yubikey doesn't support the Delete-operation.

Remarks

Internally this method attempts to authenticate to the Yubikey by calling AuthenticateManagementKey(bool) which may in turn throw its' own exceptions.

See Also

PivSlot
PivSlot
AuthenticateManagementKey(bool)
In this article
Back to top Generated by DocFX