Table of Contents

Class EccP256CredentialWithSecrets

Namespace
Yubico.YubiKey.YubiHsmAuth
Assembly
Yubico.YubiKey.dll

This class is used when adding a new credential with an ECC P-256 private key to the YubiHSM Auth application.

public class EccP256CredentialWithSecrets : CredentialWithSecrets
Inheritance
object
EccP256CredentialWithSecrets
Inherited Members

Constructors

EccP256CredentialWithSecrets(ReadOnlyMemory<byte>, ReadOnlyMemory<byte>, string, bool)

Create an ECC P-256 credential to be stored in the YubiHSM Auth application.

public EccP256CredentialWithSecrets(ReadOnlyMemory<byte> credentialPassword, ReadOnlyMemory<byte> privateKey, string label, bool touchRequired)

Parameters

credentialPassword ReadOnlyMemory<byte>

The credential password is required when performing operations that access the key, such as calculating session keys. Its length must be equal to RequiredCredentialPasswordLength.

privateKey ReadOnlyMemory<byte>

Sets PrivateKey.

label string

Sets Label.

touchRequired bool

Sets TouchRequired.

Exceptions

ArgumentException

Thrown when the ECC P-256 private key does not have the required size (see RequiredKeySize).

Fields

RequiredKeySize

An ECC P-256 private key must be exactly 32 bytes.

public const int RequiredKeySize = 32

Field Value

int

Properties

PrivateKey

The ECC P-256 private key. Its length must be equal to RequiredKeySize.

public ReadOnlyMemory<byte> PrivateKey { get; set; }

Property Value

ReadOnlyMemory<byte>

Remarks

The caller is responsible for controlling the buffer which holds this value, and should overwrite the data after the command (see AddCredentialCommand) is sent. The user's manual entry "Sensitive Data" has further details and recommendations for handling this kind of data.

Exceptions

ArgumentException

Thrown when the key does not have the required size.