Table of Contents

Class ChallengeResponseResponse

Namespace
Yubico.YubiKey.Otp.Commands
Assembly
Yubico.YubiKey.dll

The response to the ChallengeResponseCommand command, containing the YubiKey's response to the issued challenge.

public class ChallengeResponseResponse : OtpResponse, IYubiKeyResponseWithData<ReadOnlyMemory<byte>>, IYubiKeyResponse
Inheritance
object
ChallengeResponseResponse
Implements
IYubiKeyResponseWithData<ReadOnlyMemory<byte>>
Inherited Members

Constructors

ChallengeResponseResponse(ResponseApdu, ChallengeResponseAlgorithm)

Constructs a ChallengeResponseResponse instance based on a ResponseApdu received from the YubiKey, and the algorithm requested for generating the response.

public ChallengeResponseResponse(ResponseApdu responseApdu, ChallengeResponseAlgorithm algorithm)

Parameters

responseApdu ResponseApdu

The ResponseApdu returned by the YubiKey.

algorithm ChallengeResponseAlgorithm

The algorithm used when the ChallengeResponseCommand was sent.

Methods

GetData()

Gets the response to the issued challenge.

public ReadOnlyMemory<byte> GetData()

Returns

ReadOnlyMemory<byte>

The response to the challenge. The size of the response will be 16 bytes if the YubicoOtp algorithm was used, or 20 bytes if the HMAC-SHA1 algorithm was used.

Exceptions

InvalidOperationException

Thrown when Status is not Success.

MalformedYubiKeyResponseException

Thrown when the data received from the YubiKey does not match the expectations of the parser.