Table of Contents

Class BioEnrollmentData

Namespace
Yubico.YubiKey.Fido2.Commands
Assembly
Yubico.YubiKey.dll

Contains the data returned by the YubiKey after calling one of the authenticatorBioEnrollment subcommands.

public class BioEnrollmentData
Inheritance
object
BioEnrollmentData

Remarks

When a BioEnrollment subcommand is sent to the YubiKey, it returns data encoded following the definition of the authenticatorBioEnrollment response. The FIDO2 standard defines this encoded response as a map of a set of elements. The standard also specifies which subset of the total data is returned by each subcommand.

After calling one of the subcommands, get the data out of the response. It will be an instance of this class. Only those elements the particular subcommand returns will be represented in the object, the rest will be null.

For example, if you call the get modality subcommand, the YubiKey will return the modality (an integer). Hence, the only property with a value will be Modality. All other properties will be null.

Constructors

BioEnrollmentData(ReadOnlyMemory<byte>)

Build a new instance of BioEnrollmentData based on the given CBOR encoding.

public BioEnrollmentData(ReadOnlyMemory<byte> cborEncoding)

Parameters

cborEncoding ReadOnlyMemory<byte>

The BioEnrollment data, encoded following the CTAP 2.1 and CBOR (RFC 8949) standards.

Exceptions

Ctap2DataException

The cborEncoding is not a valid CBOR encoding, or it is not a correct encoding for FIDO2 BioEnrollment data.

Properties

FingerprintKind

The kind of fingerprint reader, that is, what method the fingerprint reader uses. This is an optional element and can be null.

public int? FingerprintKind { get; }

Property Value

int?

Remarks

The value returned by the YubiKey is an integer. The standard defines what each integer means. Currently only two integers are defined: 1 for touch type sensor and 2 for swipe type sensor.

LastEnrollSampleStatus

The result of the most recent attempt to provide a fingerprint sample. This is an optional element and can be null.

public int? LastEnrollSampleStatus { get; }

Property Value

int?

MaxCaptureCount

The number of "good" fingerprint captures required to enroll. This is an optional element and can be null.

public int? MaxCaptureCount { get; }

Property Value

int?

Remarks

In order to enroll a fingerprint, it is necessary to provide the fingerprint. The reader will need several examples of the fingerprint, generally from a number of angles. Once it has MaxCaptureCount good examples, it will consider the fingerprint enrolled. If it cannot get enough "good" examples, it will not accept the fingerprint and will require the user to start over.

MaxFriendlyNameBytes

The maximum length, in bytes, of a template friendly name. This is an optional element and can be null.

public int? MaxFriendlyNameBytes { get; }

Property Value

int?

Remarks

A "template" is one biometric entry: all the data the YubiKey stores for one fingerprint. The FIDO2 standard uses the word template because there could be several types of biometric entries, such as fingerprint, face, voice, or more. So one template is one entry. The friendly name can be "right-index" or "left-thumb".

With the SDK, you provide a friendly name as a string. Before it is stored, it is converted to UTF-8. The length, in bytes, of the friendly name is therefore the number of bytes in the UTF-8 array that is the converted string.

Modality

The modality of the YubiKey Bio component. The modality is the technique used to obtain Bio authentication. This is an optional element and can be null.

public int? Modality { get; }

Property Value

int?

Remarks

The value returned by the YubiKey is an integer. The standard defines what each integer means. Currently, the standard defines only one modality, fingerprint, and that is the integer 1.

RemainingSampleCount

The number of successful fingerprint samples required to complete an enrollment. This is an optional element and can be null.

public int? RemainingSampleCount { get; }

Property Value

int?

TemplateId

The template ID of the fingerprint being enrolled. This is an optional element and can be null.

public ReadOnlyMemory<byte>? TemplateId { get; }

Property Value

ReadOnlyMemory<byte>?

TemplateInfos

The enumeration of enrolled fingerprints. This is an optional element and can be null.

public IReadOnlyList<TemplateInfo>? TemplateInfos { get; }

Property Value

IReadOnlyList<TemplateInfo>

Remarks

This is a list of templateId/friendlyName pairs.