Show / Hide Table of Contents

CreateCommandApdu Method

CreateCommandApdu()

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

C#
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.

Implements

IYubiKeyCommand<TResponse>.CreateCommandApdu()

Remarks

This version of the CreateCommandApdu method will build the APDU for the authenticatorCredentialManagement command. That is, it is equivalent to calling CreateCommandApdu(false).

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.

CreateCommandApdu(bool)

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

C#
public CommandApdu CreateCommandApdu(bool isPreview)

Parameters

Type Name Description
bool isPreview

Indicates whether this command should use the CredentialMgmtPreview command (true) or authenticatorCredentialManagement (false). This is an optional arg, and if not given the default will be false.

Returns

CommandApdu

Remarks

This version of the CreateCommandApdu method contains an arg indicating whether it should build an APDU for the CredentialMgmtPreview command (true) or for the authenticatorCredentialManagement command (false).

The authenticatorCredentialManagement command was introduced in FIDO2.1. Hence, YubiKeys that do not support 2.1 will not have this feature. However, there was a version "2_1_PRE" which contained the "CredentialMgmtPreview" command. Each "credMgmt" command has a corresponding operation in this preview command.

If the YubiKey does not support "credMgmt" but does support "CredentialMgmtPreview", then pass true as the isPreview arg. Otherwise, either pass false to this method or call the CreateCommandApdu method that take no argument.

In this article
Back to top Generated by DocFX