Show / Hide Table of Contents

UnlockConfiguration Method

UnlockConfiguration(ReadOnlySpan<byte>)

Removes the configuration lock code, allowing changes to YubiKey's user-settable IYubiKeyDeviceInfo values.

C#
public void UnlockConfiguration(ReadOnlySpan<byte> lockCode)

Parameters

Type Name Description
ReadOnlySpan<byte> lockCode

The lock code currently set on the YubiKey. This lock code must have a length equal to LockCodeLength.

Implements

IYubiKeyDevice.UnlockConfiguration(ReadOnlySpan<byte>)

Exceptions

Type Condition
ArgumentException

The length of lockCode is invalid.

InvalidOperationException

The command failed to complete.

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.

See Also

SetDeviceInfoCommand
In this article
Back to top Generated by DocFX