UnlockConfiguration Method
UnlockConfiguration(ReadOnlySpan<Byte>)
Removes the configuration lock code, allowing changes to YubiKey's user-settable IYubiKeyDeviceInfo values.
void UnlockConfiguration(ReadOnlySpan<byte> lockCode)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<System.Byte> | lockCode | The lock code currently set on the YubiKey. This lock code must have a length equal to LockCodeLength. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The length of |
System.InvalidOperationException | The command failed to complete. |
System.NotSupportedException | An error occurred when attempting to connect to the device. |
Remarks
See ConfigurationLocked.
By removing the lock code, changes can be made to the YubiKey's user-settable IYubiKeyDeviceInfo values. To lock the configuration, use LockConfiguration(ReadOnlySpan<Byte>).
If this operation is attempted on a device that is already unlocked,
lockCode
must be all zeros. Otherwise the operation will fail and
throw an System.InvalidOperationException. In both cases, the device remains
unlocked.