Class ChallengeResponseResponse
The response to the ChallengeResponseCommand command, containing the YubiKey's response to the issued challenge.
public class ChallengeResponseResponse : OtpResponse, IYubiKeyResponseWithData<ReadOnlyMemory<byte>>, IYubiKeyResponse
- Inheritance
-
objectChallengeResponseResponse
- Implements
- 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
ResponseApduThe ResponseApdu returned by the YubiKey.
algorithm
ChallengeResponseAlgorithmThe 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
- MalformedYubiKeyResponseException
Thrown when the data received from the YubiKey does not match the expectations of the parser.