DeleteKey Method
DeleteKey(byte)
Deletes/clears any key at a given PivSlot.
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 |
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.