Table of Contents

Class BioEnrollmentResponse

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

The response partner to the BioEnrollmentCommand.

public class BioEnrollmentResponse : Fido2Response, IYubiKeyResponseWithData<BioEnrollmentData>, IYubiKeyResponse
Inheritance
object
BioEnrollmentResponse
Implements
Inherited Members

Remarks

The standard specifies that all BioEnrollment responses that return data, return a specified map consisting of several elements. This class will be able to return a data struct that contains all those elements. However, not every response contains all elements. Hence, some will be null. Individual subcommand response classes will call on this class to parse the response, then return only those elements it can.

Constructors

BioEnrollmentResponse(ResponseApdu)

Constructs a new instance of BioEnrollmentResponse based on a response APDU provided by the YubiKey.

public BioEnrollmentResponse(ResponseApdu responseApdu)

Parameters

responseApdu ResponseApdu

A response APDU containing the CBOR response data for the authenticatorBioEnrollment command.

Methods

GetData()

Gets the data from the YubiKey response.

public virtual BioEnrollmentData GetData()

Returns

BioEnrollmentData

The data returned by the YubiKey, presented in a manner specific to each implementation.

Remarks

If the method cannot return the data, it will throw an exception. This happens when the Status property indicates an error, or the data returned from the YubiKey was malformed or incomplete.

For example,

IYubiKeyConnection connection = key.Connect(YubiKeyApplication.Piv);
GetDataCommand getDataCommand = new GetDataCommand(PivDataTag.Chuid);
GetDataResponse getDataResponse = connection.SendCommand(getDataCommand);
if (getDataResponse.Status == ResponseStatus.Success)
{
    byte[] getChuid = getDataResponse.GetData();
}