Table of Contents

Class InitializeAuthenticateManagementKeyResponse

Namespace
Yubico.YubiKey.Piv.Commands
Assembly
Yubico.YubiKey.dll

The response to the initialize authenticate management key command.

public sealed class InitializeAuthenticateManagementKeyResponse : PivResponse, IYubiKeyResponseWithData<(bool isMutualAuth, ReadOnlyMemory<byte> clientAuthenticationChallenge)>, IYubiKeyResponse
Inheritance
object
InitializeAuthenticateManagementKeyResponse
Implements
IYubiKeyResponseWithData<(bool isMutualAuth, ReadOnlyMemory<byte> clientAuthenticationChallenge)>
Inherited Members

Remarks

This is the partner Response class to InitializeAuthenticateManagementKeyCommand.

The data returned is a tuple consisting of a boolean and a ReadOnlyMemory<byte>. The boolean indicates if this is mutual authentication or not, true for mutual auth, false for single. The byte array is "Client Authentication Challenge".

See the comments for the class InitializeAuthenticateManagementKeyCommand, there is a lengthy discussion of the process of authenticating the management key, including descriptions of the challenges and responses.

It is likely that you will never need to call GetData in this class. You will pass an instance of this class to the constructor for CompleteAuthenticateManagementKeyCommand, which will process the challenge.

Constructors

InitializeAuthenticateManagementKeyResponse(ResponseApdu, PivAlgorithm)

Constructs an InitializeAuthenticateManagementKeyResponse based on a ResponseApdu received from the YubiKey for the specified algorithm.

public InitializeAuthenticateManagementKeyResponse(ResponseApdu responseApdu, PivAlgorithm algorithm)

Parameters

responseApdu ResponseApdu

The object containing the Response APDU
returned by the YubiKey.

algorithm PivAlgorithm

The algorithm of the management key. It must be TripleDes, Aes128, Aes192, or Aes256,

Exceptions

MalformedYubiKeyResponseException

Thrown when the data provided does not meet the expectations, and cannot be parsed.

Properties

Algorithm

Which algorithm is the management key.

public PivAlgorithm Algorithm { get; }

Property Value

PivAlgorithm

Methods

GetData()

Return the boolean indicating mutual auth or not, along with the value portion of the Response Data, namely, Client Authentication Challenge.

public (bool isMutualAuth, ReadOnlyMemory<byte> clientAuthenticationChallenge) GetData()

Returns

(bool isMutualAuth, ReadOnlyMemory<byte> clientAuthenticationChallenge)

A (bool, byte array) tuple
if this is mutual auth and
the 8 bytes that make up the Client Authentication Challenge.

Exceptions

InvalidOperationException

Thrown when Status is not Success.