Table of Contents

Class U2fBuffer

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

This is a base class for those classes that need to collect and encode data into a single buffer, either as data in a command or data to verify. This will hold the buffer along with the Application ID Hash and Client Data Hash. Subclasses can add more data to be placed into the buffer.

public abstract class U2fBuffer
Inheritance
object
U2fBuffer
Derived

Remarks

Only the SDK will ever need to create subclasses, there is no reason for any other application to do so.

Constructors

U2fBuffer(int, int, int)

Initialize the object to the given values.

protected U2fBuffer(int bufferLength, int appIdOffset, int clientDataOffset)

Parameters

bufferLength int
appIdOffset int
clientDataOffset int

Fields

AppIdHashLength

protected const int AppIdHashLength = 32

Field Value

int

ClientDataHashLength

protected const int ClientDataHashLength = 32

Field Value

int

CoordinateLength

protected const int CoordinateLength = 32

Field Value

int

CounterLength

protected const int CounterLength = 4

Field Value

int

KeyHandleLength

protected const int KeyHandleLength = 64

Field Value

int

PublicKeyLength

protected const int PublicKeyLength = 65

Field Value

int

PublicKeyTag

protected const byte PublicKeyTag = 4

Field Value

byte

Properties

ApplicationId

Set the ApplicationIdHash. It must be 32 bytes long.

public ReadOnlyMemory<byte> ApplicationId { get; set; }

Property Value

ReadOnlyMemory<byte>

ClientDataHash

Set and get the ClientDataHash or "challenge". It must be 32 bytes long.

public ReadOnlyMemory<byte> ClientDataHash { get; set; }

Property Value

ReadOnlyMemory<byte>

Methods

SetBufferData(ReadOnlyMemory<byte>, int, int, string)

Copy the buffer data into the _buffer beginning at the given offset. Throw an exception if the input length is not correct.

protected void SetBufferData(ReadOnlyMemory<byte> bufferData, int expectedLength, int offset, string variableName)

Parameters

bufferData ReadOnlyMemory<byte>
expectedLength int
offset int
variableName string