VersionCommand Class
Namespace: Yubico.YubiKey.Piv.Commands Assembly: Yubico.YubiKey.dllGet the YubiKey's firmware version number.
C#
public sealed class VersionCommand : Object, IYubiKeyCommand<VersionResponse>
Inheritance
System.Object
VersionCommand
Implements
Remarks
The partner Response class is VersionResponse.
Example:
IYubiKeyConnection connection = key.Connect(YubiKeyApplication.Piv);
VersionCommand versionCmd = new VersionCommand();
VersionResponse versionRsp = connection.SendCommand(versionCmd);
if (versionNum.Status == ResponseStatus.Success)
{
FirmwareVersion versionNum = versionRsp.GetData();
}
Constructors
Name | Description |
---|---|
VersionCommand() | Initializes a new instance of the VersionCommand class. This command has no input. |
Properties
Name | Description |
---|---|
Application | Gets the YubiKeyApplication to which this command belongs. For this command it's PIV. |
Methods
Name | Description |
---|---|
CreateCommandApdu() | Creates a well-formed CommandApdu to send to the YubiKey. |
CreateResponseForApdu(ResponseApdu) | Creates the corresponding IYubiKeyResponse implementation for the current command. |