Table of Contents

Class SetLegacyDeviceConfigCommand

Namespace
Yubico.YubiKey.U2f.Commands
Assembly
Yubico.YubiKey.dll

Writes configuration settings that are supported by YubiKeys prior to firmware version 5.

public sealed class SetLegacyDeviceConfigCommand : SetLegacyDeviceConfigBase, IYubiKeyCommand<SetLegacyDeviceConfigResponse>
Inheritance
object
SetLegacyDeviceConfigCommand
Implements
Inherited Members

Remarks

This is the only configuration operation available to YubiKeys prior to firmware version 5. These YubiKeys have limited configuration settings, and all of them must be set at the same time.

Constructors

SetLegacyDeviceConfigCommand(SetLegacyDeviceConfigBase)

Creates a new SetLegacyDeviceConfigCommand from another object which derives from SetLegacyDeviceConfigBase.

public SetLegacyDeviceConfigCommand(SetLegacyDeviceConfigBase baseCommand)

Parameters

baseCommand SetLegacyDeviceConfigBase

The SetLegacyDeviceConfig base command object to copy from.

Remarks

This constructor can be useful to switch between different application-specific implementations of the same base command.

SetLegacyDeviceConfigCommand(YubiKeyCapabilities, byte, bool, int)

Initializes a new instance of the SetLegacyDeviceConfigCommand class.

public SetLegacyDeviceConfigCommand(YubiKeyCapabilities yubiKeyInterfaces, byte challengeResponseTimeout, bool touchEjectEnabled, int autoEjectTimeout)

Parameters

yubiKeyInterfaces YubiKeyCapabilities

Value for YubiKeyInterfaces.

challengeResponseTimeout byte

Value for ChallengeResponseTimeout.

touchEjectEnabled bool

Value for TouchEjectEnabled.

autoEjectTimeout int

Value for AutoEjectTimeout.

Remarks

This command sends all configuration settings every time. Therefore all values must be provided every time.

Exceptions

ArgumentException

Thrown if yubiKeyInterfaces contains unsupported flags.

ArgumentOutOfRangeException

Thrown when autoEjectTimeout is out of the valid range.

Properties

Application

Gets the YubiKeyApplication (e.g. PIV, OATH, etc.) to which this command applies.

public YubiKeyApplication Application { get; }

Property Value

YubiKeyApplication

YubiKeyApplication.Otp, YubiKeyApplication.Piv, etc.

Methods

CreateCommandApdu()

Creates a well-formed CommandApdu to send to the YubiKey.

public CommandApdu CreateCommandApdu()

Returns

CommandApdu

A valid CommandApdu that is ready to be sent to the YubiKey, or passed along to additional encoders for further processing.

Remarks

This method will first perform validation on all of the parameters and data provided to it. The CommandAPDU it creates should contain all of the data payload for the command, even if it exceeds 65,535 bytes as specified by the ISO 7816-4 specification. The APDU will be properly chained by the device connection prior to being sent to the YubiKey, and the responses will collapsed into a single result.

CreateResponseForApdu(ResponseApdu)

Creates the corresponding IYubiKeyResponse implementation for the current command.

public SetLegacyDeviceConfigResponse CreateResponseForApdu(ResponseApdu responseApdu)

Parameters

responseApdu ResponseApdu

The ResponseApdu returned by the YubiKey.

Returns

SetLegacyDeviceConfigResponse

The implementation of IYubiKeyResponse that parses and presents ths response APDU.