GetMetadataCommand Class
Namespace: Yubico.YubiKey.Piv.Commands Assembly: Yubico.YubiKey.dllGet information about the key in a specified slot.
public sealed class GetMetadataCommand : Object, IYubiKeyCommand<GetMetadataResponse>
Implements
Remarks
The Get Metadata command is available on YubiKey version 5.3 and later.
The partner Response class is GetMetadataResponse.
See the User's Manual entry on getting metadata for specific information about what information is returned. Different slots return different sets of data.
Example:
IYubiKeyConnection connection = key.Connect(YubiKeyApplication.Piv);
GetMetadataCommand metadataCommand = new GetMetadataCommand(0x9A);
GetMetadataResponse metadataResponse = connection.SendCommand(metadataCommand);
if (metadataResponse.Status == ResponseStatus.Success)
{
PivKeyMetadata keyData = metadataResponse.GetData();
}
Constructors
Name | Description |
---|---|
GetMetadataCommand() | Initializes a new instance of the GetMetadataCommand class. |
GetMetadataCommand(Byte) | Initializes a new instance of the GetMetadataCommand class. This command takes the slot number as input. |
Properties
Name | Description |
---|---|
Application | Gets the YubiKeyApplication to which this command belongs. For this command it's PIV. |
SlotNumber | The slot for which the metadate is requested. |
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. |