ImportAsymmetricKeyResponse Class

Namespace: Yubico.YubiKey.Piv.Commands Assembly: Yubico.YubiKey.dll

The response to the import asymmetric key command, containing the result of the import process.

C#
public class ImportAsymmetricKeyResponse : PivResponse, IYubiKeyResponse
Inheritance System.Object YubiKeyResponse PivResponse ImportAsymmetricKeyResponse
Implements
IYubiKeyResponse

Remarks

This is the partner Response class to ImportAsymmetricKeyCommand.

This class does not return any Data (there is no GetData method).

To determine the status of the command, examine the Status property. ResponseStatus.Success means the command executed correctly. Other values represent various errors. For example, ResponseStatus.AuthenticationRequired indicates that the user verification (management key) failed, so the command was not sucessful.

Example:

  var privateKey = new PivEccPrivateKey(privateValue);
  IYubiKeyConnection connection = key.Connect(YubiKeyApplication.Piv);
var importKeyCommand = new ImportAsymmetricKeyCommand( privateKey, PivSlot.Signing, PivPinPolicy.Default, PivTouchPolicy.Default); ImportAsymmetricKeyResponse importAsymmetricKeyResponse = connection.SendCommand(importAsymmetricKeyCommand);
if (importAsymmetricKeyResponse.Status != ResponseStatus.Success) { // Handle error } privateKey.Clear();

Constructors

Name Description
ImportAsymmetricKeyResponse(ResponseApdu)

Constructs an ImportAsymmetricKeyResponse based on a ResponseApdu received from the YubiKey.

Generated by DocFX