DeleteKey Method
DeleteKey(Byte)
Deletes/clears any key at a given PivSlot.
public void DeleteKey(byte slotToClear)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | slotToClear | The Yubikey slot of the key you want to clear. This must be a valid slot number. |
Exceptions
Type | Condition |
---|---|
System.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. |
System.OperationCanceledException | The user canceled management key collection. |
System.Security.SecurityException | Mutual authentication was performed and the YubiKey was not authenticated. |
System.NotSupportedException | Thrown when the Yubikey doesn't support the Delete-operation. |
Remarks
Internally this method attempts to authenticate to the Yubikey by calling AuthenticateManagementKey(Boolean) which may in turn throw its' own exceptions.