Show / Hide Table of Contents

YubiKeyDevice Class

Namespace: Yubico.YubiKey Assembly: Yubico.YubiKey.dll

Provides device and enumeration capabilities.

C#
public class YubiKeyDevice : IYubiKeyDevice, IYubiKeyDeviceInfo
Inheritance object YubiKeyDevice
Implements
IYubiKeyDevice
IYubiKeyDeviceInfo

Constructors

Name Description
YubiKeyDevice(IDevice, IYubiKeyDeviceInfo)

Constructs a YubiKeyDevice instance.

YubiKeyDevice(ISmartCardDevice?, IHidDevice?, IHidDevice?, IYubiKeyDeviceInfo)

Construct a YubiKeyDevice instance.

Properties

Name Description
AutoEjectTimeout

The CCID auto-eject timeout (in seconds).

AvailableNfcCapabilities

The paid-for YubiKey features that are available over NFC.

AvailableTransports

Indicates which logical device transports are available to this YubiKey device.

AvailableUsbCapabilities

The paid-for YubiKey features that are available over USB (and Lightning).

ChallengeResponseTimeout

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

ConfigurationLocked

Indicates whether or not the YubiKey's configuration has been locked by the user.

DeviceFlags

Device flags that can control device-global behavior.

EnabledNfcCapabilities

The NFC features that are currently enabled over NFC.

EnabledUsbCapabilities

The USB features that are currently enabled over USB (and Lightning).

FipsApproved

The set of YubiKey applications that are currently configured to meet FIPS requirements.

FipsCapable

The set of YubiKey applications that are capable of being put into FIPS mode.

FirmwareVersion

The version of the firmware currently running on the YubiKey.

FormFactor

The form-factor of the YubiKey.

ImageProcessorVersion

The version of the chip/firmware performing the image processing. If there is no image processing chip, this will be null. This field is also known as the "STM Version".

IsFipsSeries

Indicates whether or not the YubiKey is a FIPS Series device.

IsNfcRestricted

Indicates if the NFC connectivity on the device is temporarily disabled

IsPinComplexityEnabled

Whether or not pin complexity is enabled on the Yubikey. For more information see this documentation on pin complexity

IsSkySeries

Indicates whether or not this device is a "Security Key by Yubico" series device.

PartNumber

The part number for the Secure Element processor, if available, otherwise null

ResetBlocked

The set of YubiKey applications that are blocked from being reset.

SerialNumber

The serial number of the YubiKey, if one is present. Security Keys don't have serial numbers

TemplateStorageVersion

The version of the chip/firmware storing the fingerprints (the second secure element). If there is no template storage chip, this will be null. This field is also known as the "FPS Version".

Methods

Name Description
CompareTo(IYubiKeyDevice)
Connect(byte[])

Initiate a connection to the specified application represented as an applicationId on a YubiKey device.

Connect(byte[], ScpKeyParameters)

Initiate a connection to the specified application on a YubiKey device using SCP protocol.

Connect(YubiKeyApplication)

Initiate a connection to the specified application on a YubiKey device.

Connect(YubiKeyApplication, ScpKeyParameters)

Initiate a connection to the specified application on a YubiKey device using SCP protocol.

Connect(YubiKeyApplication, StaticKeys)
ConnectScp03(byte[], StaticKeys)
ConnectScp03(YubiKeyApplication, StaticKeys)
Contains(IDevice)
DeviceReset()

Perform a device-wide factory reset on a YubiKey Bio Multi-protocol Edition key.

Equals(object)
Equals(IYubiKeyDevice)
FindAll()

Enumerate all YubiKeys on the system over all available transports.

FindByTransport(Transport)

Enumerate YubiKeys over the given transports.

GetHashCode()
HasSameParentDevice(IDevice)
LockConfiguration(ReadOnlySpan<byte>)

Sets a configuration lock code, which prevents changes to YubiKey's user-settable IYubiKeyDeviceInfo values.

SetAutoEjectTimeout(int)

Sets the CCID auto-eject timeout (in seconds).

SetChallengeResponseTimeout(int)

Sets the timeout on OTP challenge-response operations.

SetDeviceFlags(DeviceFlags)

Modifies the value of DeviceFlags.

SetEnabledNfcCapabilities(YubiKeyCapabilities)

Sets which NFC features are enabled (and disabled).

SetEnabledUsbCapabilities(YubiKeyCapabilities)

Sets which USB features are enabled (and disabled).

SetIsNfcRestricted(bool)

Sets the IsNfcRestricted on the YubiKeyDeviceInfo

SetLegacyDeviceConfiguration(YubiKeyCapabilities, byte, bool, int)

Manage configuration settings on YubiKeys prior to firmware version 5.

SetTemporaryTouchThreshold(int)

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

ToString()
TryConnect(byte[], out IYubiKeyConnection)

Attempt to connect to the YubiKey device.

TryConnect(byte[], ScpKeyParameters, out IScpYubiKeyConnection)

Attempt to connect to the YubiKey device over SCP using the specified ScpKeyParameters

TryConnect(YubiKeyApplication, out IYubiKeyConnection)

Attempt to connect to the YubiKey device.

TryConnect(YubiKeyApplication, ScpKeyParameters, out IScpYubiKeyConnection)

Attempt to connect to the YubiKey device over SCP using the specified ScpKeyParameters

TryConnectScp03(byte[], StaticKeys, out IScp03YubiKeyConnection)
TryConnectScp03(YubiKeyApplication, StaticKeys, out IScp03YubiKeyConnection)
TryGetYubiKey(int, out IYubiKeyDevice)

Get info on a specific YubiKey by serial number.

UnlockConfiguration(ReadOnlySpan<byte>)

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

Operators

Name Description
operator ==(YubiKeyDevice, YubiKeyDevice)
operator >(YubiKeyDevice, YubiKeyDevice)
operator >=(YubiKeyDevice, YubiKeyDevice)
operator !=(YubiKeyDevice, YubiKeyDevice)
operator <(YubiKeyDevice, YubiKeyDevice)
operator <=(YubiKeyDevice, YubiKeyDevice)

Extension Methods

PivSessionExtensions.ThrowIfUnsupportedAlgorithm(IYubiKeyDevice, PivAlgorithm)
YubiKeyFeatureExtensions.HasFeature(IYubiKeyDevice, YubiKeyFeature)
YubiKeyFeatureExtensions.ThrowOnMissingFeature(IYubiKeyDevice, YubiKeyFeature)
YubiKeyDeviceExtensions.WithScp03(YubiKeyDevice, StaticKeys)
In this article
Back to top Generated by DocFX