GetSerialNumberResponse Class
Namespace: Yubico.YubiKey.Piv.Commands Assembly: Yubico.YubiKey.dllThe response to the get serial number command, containing the YubiKey's serial number.
C#
public sealed class GetSerialNumberResponse : PivResponse, IYubiKeyResponseWithData<int>, IYubiKeyResponse
Remarks
This is the partner Response class to GetSerialNumberCommand.
The data returned is an int
.
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 |
---|---|
GetSerialNumberResponse(ResponseApdu) | Constructs a GetSerialNumberResponse based on a ResponseApdu received from the YubiKey. |
Methods
Name | Description |
---|---|
GetData() | Gets the serial number from the YubiKey response. |