PutKey Method
PutKey(KeyReference, StaticKeys, Int32)
Puts an SCP03 key set onto the YubiKey using the Security Domain.
public void PutKey(KeyReference keyReference, StaticKeys staticKeys, int replaceKvn = 0)
Parameters
Type | Name | Description |
---|---|---|
KeyReference | keyReference | The key reference identifying where to store the key. |
StaticKeys | staticKeys | The new SCP03 key set to store. |
System.Int32 | replaceKvn | The key version number to replace, or 0 for a new key (Default value is 0). |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the KID is not 0x01 for SCP03 key sets. |
SecureChannelException | Thrown when the new key set's checksum failed to verify, or some other SCP related error described in the exception message. |
PutKey(KeyReference, ECPrivateKeyParameters, Int32)
Puts an EC private key onto the YubiKey using the Security Domain.
public void PutKey(KeyReference keyReference, ECPrivateKeyParameters privateKeyParameters, int replaceKvn = 0)
Parameters
Type | Name | Description |
---|---|---|
KeyReference | keyReference | The key reference identifying where to store the key. |
ECPrivateKeyParameters | privateKeyParameters | The EC private key parameters to store. |
System.Int32 | replaceKvn | The key version number to replace, or 0 for a new key (Default value is 0). |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the private key is not of type NIST P-256. |
System.InvalidOperationException | Thrown when no secure session is established. |
SecureChannelException | Thrown when the new key set's checksum failed to verify, or some other SCP related error described in the exception message. |
PutKey(KeyReference, ECPublicKeyParameters, Int32)
Puts an EC public key onto the YubiKey using the Security Domain.
public void PutKey(KeyReference keyReference, ECPublicKeyParameters publicKeyParameters, int replaceKvn = 0)
Parameters
Type | Name | Description |
---|---|---|
KeyReference | keyReference | The key reference identifying where to store the key. |
ECPublicKeyParameters | publicKeyParameters | The EC public key parameters to store. |
System.Int32 | replaceKvn | The key version number to replace, or 0 for a new key (Default value is 0). |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the public key is not of type SECP256R1. |
System.InvalidOperationException | Thrown when no secure session is established. |
SecureChannelException | Thrown when the new key set's checksum failed to verify, or some other SCP related error described in the exception message. |