VersionResponse Class
Namespace: Yubico.YubiKey.Piv.Commands Assembly: Yubico.YubiKey.dllThe response to the get version command, containing the YubiKey's firmware version.
C#
public sealed class VersionResponse : PivResponse, 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. |