Table of Contents

Class KeyDefinition

Namespace
Yubico.YubiKey.Cryptography
Assembly
Yubico.YubiKey.dll

Represents the definition of a cryptographic key, including its type, length, and other properties.

public class KeyDefinition
Inheritance
object
KeyDefinition
Extension Methods

Properties

AlgorithmOid

Gets or sets the object identifier (OID) of the key.

public string AlgorithmOid { get; init; }

Property Value

string

CoseKeyDefinition

Gets or sets the COSE key definition associated with this key.

public CoseKeyDefinition? CoseKeyDefinition { get; init; }

Property Value

CoseKeyDefinition

CurveOid

Gets or sets the curve OID for elliptic curve keys.

public string? CurveOid { get; init; }

Property Value

string

IsAsymmetric

Indicates whether the key is a asymmetric key.

public bool IsAsymmetric { get; }

Property Value

bool

IsEllipticCurve

Indicates whether the key is an elliptic curve (EC) key.

public bool IsEllipticCurve { get; }

Property Value

bool

IsRSA

Indicates whether the key is an RSA key.

public bool IsRSA { get; }

Property Value

bool

IsSymmetric

Indicates whether the key is a symmetric key.

public bool IsSymmetric { get; }

Property Value

bool

KeyType

Gets or sets the type of the key.

public KeyType KeyType { get; init; }

Property Value

KeyType

LengthInBits

Gets or sets the length of the key in bits.

public int LengthInBits { get; init; }

Property Value

int

LengthInBytes

Gets or sets the length of the key in bytes.

public int LengthInBytes { get; init; }

Property Value

int

Name

Gets the name of the key, which is the string representation of the key type.

public string Name { get; }

Property Value

string

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string