GetSerialNumberCommand Class
Namespace: Yubico.Get the YubiKey's serial number.
C#
public sealed class GetSerialNumberCommand : Object, IYubiKeyCommand<GetSerialNumberResponse>
Inheritance
System.Object
GetSerialNumberCommand
Implements
Remarks
The partner Response class is Get
Example:
IYubiKeyConnection connection = key.Connect(YubiKeyApplication.Piv);
SerialCommand serialCommand = new GetSerialNumberCommand();
GetSerialNumberResponse serialResponse = connection.SendCommand(serialCommand);
if (serialResponse.Status == ResponseStatus.Success)
{
int serialNum = serialResponse.GetData();
}
Constructors
Name | Description |
---|---|
Get |
Initializes a new instance of the GetSerialNumberCommand 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 |
---|---|
Create |
Creates a well-formed CommandApdu to send to the YubiKey. |
Create |
Creates the corresponding IYubiKeyResponse implementation for the current command. |