Table of Contents

Class CredentialUserInfo

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

Contains the info about a user in one credential on the YubiKey. This is the class returned when calling EnumerateCredentialsForRelyingParty(RelyingParty).

public class CredentialUserInfo
Inheritance
object
CredentialUserInfo

Constructors

CredentialUserInfo(UserEntity, CredentialId, CoseKey, int, ReadOnlyMemory<byte>?, bool?)

Build a new instance of CredentialUserInfo based on the given objects related to a user.

public CredentialUserInfo(UserEntity user, CredentialId credentialId, CoseKey credentialPublicKey, int credProtectPolicy, ReadOnlyMemory<byte>? largeBlobKey = null, bool? thirdPartyPayment = null)

Parameters

user UserEntity

The user associated with the credential.

credentialId CredentialId

The credential ID, which includes the Id and Type.

credentialPublicKey CoseKey

The public key to use when verifying a credential.

credProtectPolicy int

An int specifying the credential protection policy.

largeBlobKey ReadOnlyMemory<byte>?

If null, there is no large blob key. If not null, this is the key that can be used to encrypt or decrypt large blob data for the credential.

thirdPartyPayment bool?

Whether the credential was created as payment-enabled. If null, the authenticator did not return the thirdPartyPayment element.

Properties

CredProtectPolicy

The credential protection policy. See section 12.1.1 of the FIDO2 standard for a description of the meanings of the number returned.

public CredProtectPolicy CredProtectPolicy { get; }

Property Value

CredProtectPolicy

CredentialId

The credential ID for a credential returned.

public CredentialId CredentialId { get; }

Property Value

CredentialId

CredentialPublicKey

The public key for a credential returned.

public CoseKey CredentialPublicKey { get; }

Property Value

CoseKey

LargeBlobKey

The large blob key for a credential. If this property is null, either the credential does not have a large blob key, or it does have a large blob key but it is not requested.

public ReadOnlyMemory<byte>? LargeBlobKey { get; }

Property Value

ReadOnlyMemory<byte>?

ThirdPartyPayment

Whether this credential is third-party payment enabled. Null if the credential was not created with the thirdPartyPayment extension.

public bool? ThirdPartyPayment { get; }

Property Value

bool?

User

The user entity for a credential returned.

public UserEntity User { get; }

Property Value

UserEntity

Methods

TryGetCredentialManagementField(int, out ReadOnlyMemory<byte>)

Gets the raw CBOR-encoded value for a field in the credential management response that produced this instance.

public bool TryGetCredentialManagementField(int key, out ReadOnlyMemory<byte> encodedValue)

Parameters

key int

The integer CTAP map key to read.

encodedValue ReadOnlyMemory<byte>

The raw CBOR-encoded value for key, if present.

Returns

bool

true if the response contained key; otherwise, false.

Remarks

This method provides access to credential-specific fields in the credential-management response that do not yet have a dedicated SDK property. The returned value is the raw CBOR encoding of the field value, not a decoded .NET object. It returns false for instances that were not built from a credential-management response returned by the SDK.