Table of Contents

Class SetDeviceInfoBaseCommand

Namespace
Yubico.YubiKey.Management.Commands
Assembly
Yubico.YubiKey.dll

Base class for SetDeviceInfoCommand for Management, OTP and FIDO applications.

public class SetDeviceInfoBaseCommand
Inheritance
object
SetDeviceInfoBaseCommand
Derived

Constructors

SetDeviceInfoBaseCommand()

Initializes a new instance of the SetDeviceInfoBaseCommand class.

protected SetDeviceInfoBaseCommand()

SetDeviceInfoBaseCommand(SetDeviceInfoBaseCommand)

protected SetDeviceInfoBaseCommand(SetDeviceInfoBaseCommand baseCommand)

Parameters

baseCommand SetDeviceInfoBaseCommand

Fields

LockCodeLength

The length that a configuration lock code must be.

public const byte LockCodeLength = 16

Field Value

byte

Properties

AutoEjectTimeout

The CCID auto-eject timeout (in seconds). This field is only meaningful if the TouchEject flag in DeviceFlags is set. null to leave unchanged.

public int? AutoEjectTimeout { get; set; }

Property Value

int?

Remarks

When setting, the value must be in the range ushort.MinValue through ushort.MaxValue. Otherwise an System.ArgumentOutOfRangeException will be thrown.

ChallengeResponseTimeout

The period of time (in seconds) after which the OTP challenge-response command should timeout. null to leave unchanged.

public byte? ChallengeResponseTimeout { get; set; }

Property Value

byte?

DeviceFlags

Device flags that can control device-global behavior. null to leave unchanged.

public DeviceFlags? DeviceFlags { get; set; }

Property Value

DeviceFlags?

EnabledNfcCapabilities

The features of the YubiKey that should be enabled over NFC. null to leave unchanged.

public YubiKeyCapabilities? EnabledNfcCapabilities { get; set; }

Property Value

YubiKeyCapabilities?

EnabledUsbCapabilities

The features of the YubiKey that should be enabled over USB. null to leave unchanged.

public YubiKeyCapabilities? EnabledUsbCapabilities { get; set; }

Property Value

YubiKeyCapabilities?

ResetAfterConfig

Resets (reboots) the YubiKey after the successful application of all configuration updates. Useful if enabling or disabling capabilities.

public bool ResetAfterConfig { get; set; }

Property Value

bool

RestrictNfc

Allows setting of the IsNfcRestricted property

public bool RestrictNfc { get; set; }

Property Value

bool

TemporaryTouchThreshold

Temporarily set the threshold at which a capacitive touch should be considered active.

public int? TemporaryTouchThreshold { get; set; }

Property Value

int?

Remarks

The field is using arbitrary units and has a default value of `6`. A higher value increases the sensor threshold which has the effect of decreasing the sensitivity of the sensor. Lower values increase the sensitivity, but callers cannot reduce the threshold below the default value of `6` which is locked in at manufacturing time.

The value set here is only valid until the next time the YubiKey is power cycled. It does not persist.

You should typically not ever need to adjust this value. This is primarily used in the context of automatic provisioning and testing where the YubiKey is being "touched" by electrically grounding the sensor.

Methods

ApplyLockCode(ReadOnlySpan<byte>)

Temporarily unlocks the YubiKey's configuration by applying the lock code.

public void ApplyLockCode(ReadOnlySpan<byte> lockCode)

Parameters

lockCode ReadOnlySpan<byte>

The 16-byte lock code for this YubiKey.

GetDataForApdu()

Formats the data to be sent to the YubiKey.

protected byte[] GetDataForApdu()

Returns

byte[]

A formatted byte array.

SetLockCode(ReadOnlySpan<byte>)

Locks the YubiKey's configuration with a code. Any subsequent calls to the SetDeviceInfoBaseCommand class will need to unlock the YubiKey using the ApplyLockCode(ReadOnlySpan<byte>) method.

public void SetLockCode(ReadOnlySpan<byte> lockCode)

Parameters

lockCode ReadOnlySpan<byte>

A 16-byte lock code. A value of all zeros (16 bytes) will clear the code.