Table of Contents

Class KeyReference

Namespace
Yubico.YubiKey.Scp
Assembly
Yubico.YubiKey.dll

Represents a reference to a cryptographic key stored on the YubiKey.

public class KeyReference
Inheritance
object
KeyReference

Properties

GetBytes

Returns a span of bytes that represent the key reference.

public ReadOnlyMemory<byte> GetBytes { get; }

Property Value

ReadOnlyMemory<byte>

Id

The Key Id (KID) of the key.

public byte Id { get; }

Property Value

byte

VersionNumber

The Key Version Number (KVN) of the key.

public byte VersionNumber { get; }

Property Value

byte

Methods

Create(byte, byte)

Initializes a new instance of the KeyReference class.

public static KeyReference Create(byte id, byte versionNumber)

Parameters

id byte

The ID of the key (KID). Accepted values depend on the usage. See ScpKeyIds for a list of possible Key Id's.

versionNumber byte

The version number of the key (KVN). Must be between 1 and 127.

Returns

KeyReference

Remarks

See the GlobalPlatform Technology Card Specification v2.3 Amendment F ยง5.1 Cryptographic Keys for more information on the available KIDs.

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object in the format

"KeyRef[Kid=0x{Id:X2}, Kvn=0x{VersionNumber:X2}]"

Examples

"KeyRef[Kid=0x01, Kvn=0x02]"