Table of Contents

Class CreateHostChallengeResponse

Namespace
Yubico.YubiKey.YubiHsmAuth.Commands
Assembly
Yubico.YubiKey.dll

The response class for the CreateHostChallengeCommand.

public sealed class CreateHostChallengeResponse : YubiKeyResponse, IYubiKeyResponseWithData<ReadOnlyMemory<byte>>, IYubiKeyResponse
Inheritance
object
CreateHostChallengeResponse
Implements
IYubiKeyResponseWithData<ReadOnlyMemory<byte>>
Inherited Members

Remarks

This response contains the challenge returned by the YubiKey device based on the credential type.

For symmetric credentials this returns an 8-byte 'Host Challenge', a random value used for authentication with AES-based symmetric key protocols.

For asymmetric credentials this returns 'EPK-OCE', the public part of a newly generated ephemeral ECC SECP256R1 key (65 bytes uncompressed).

Constructors

CreateHostChallengeResponse(ResponseApdu)

Constructs a CreateHostChallengeResponse based on a ResponseApdu received from the YubiKey.

public CreateHostChallengeResponse(ResponseApdu responseApdu)

Parameters

responseApdu ResponseApdu

The ResponseApdu returned by the YubiKey.

Methods

GetData()

Gets the challenge data returned by the device.

public ReadOnlyMemory<byte> GetData()

Returns

ReadOnlyMemory<byte>

The challenge data as a System.ReadOnlyMemory<T>.

Remarks

For symmetric credentials this returns an 8-byte host challenge (random value). For asymmetric credentials this returns a 65-byte uncompressed public key in ECC P-256 format (0x04 || X || Y).

Exceptions

InvalidOperationException

The Status is not equal to Success.