Table of Contents

Interface IYubiKeyResponse

Namespace
Yubico.YubiKey
Assembly
Yubico.YubiKey.dll

This defines the minimal set of information returned by a YubiKey in response to a command.

public interface IYubiKeyResponse

Remarks

Types that implement this interface are used by IYubiKeyCommand<TResponse> to capture the command's success or failure state as reported by the YubiKey.

Implementations of IYubiKeyResponse which also need to return data should implement IYubiKeyResponseWithData<TData>.

Properties

Status

An application independent status.

ResponseStatus Status { get; }

Property Value

ResponseStatus

ResponseStatus.Success, ResponseStatus.Failed, etc.

Remarks

The Status property communicates many common error conditions. For example there is no data to return, or the command required a touch interaction. These errors are best checked and handled before calling methods that use the data returned by the YubiKey such as GetData(). (this is known as the Tester-Doer pattern).

StatusMessage

A short textual description of the status.

string StatusMessage { get; }

Property Value

string

Remarks

This intended to displayed to the end-user, when an unhandled error occurs. Programs should use Status for normal flow control.

StatusWord

The application specific status word.

short StatusWord { get; }

Property Value

short

0x9000, 0x6A82, etc.

Remarks

This is the two-byte response code of the response APDU. It is also known as the "Status Word", made up of SW1 and SW2. For example, the response code for Success is 9000, which is SW1=90 and SW2=00.