Show / Hide Table of Contents

VersionResponse Class

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

The response to the get version command, containing the YubiKey's firmware version.

C#
public sealed class VersionResponse : PivResponse, IYubiKeyResponseWithData<FirmwareVersion>, IYubiKeyResponse
Inheritance object YubiKeyResponse PivResponse VersionResponse
Implements
IYubiKeyResponseWithData<FirmwareVersion>
IYubiKeyResponse

Remarks

This is the partner Response class to VersionCommand.

The data returned is FirmwareVersion.

Example:

IList<IYubiKeyDevice> keys = YubiKey.GetList();
foreach (IYubiKeyDevice key in keys)
{
    IYubiKeyConnection connection = key.Connect(YubiKeyApplication.Piv);
    VersionCommand versionCmd = new VersionCommand();
    VersionResponse versionRsp = connection.SendCommand(versionCmd);
    if (versionNum.Status != ResponseStatus.Success)
    {
      // Handle error
    }

    FirmwareVersion versionNum = versionRsp.GetData();
}

Constructors

Name Description
VersionResponse(ResponseApdu)

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

Methods

Name Description
GetData()

Gets the version from the YubiKey response.

In this article
Back to top Generated by DocFX