AddCredentialCommand Constructor
AddCredentialCommand(ReadOnlyMemory<Byte>, CredentialWithSecrets)
Add a credential to the YubiHSM Auth application.
public AddCredentialCommand(ReadOnlyMemory<byte> managementKey, CredentialWithSecrets credentialWithSecrets)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlyMemory<System.Byte> | managementKey | The secret used to authenticate to the application prior to adding or removing credentials. See ValidManagementKeyLength for its required length. The application has a default management key of all zeros. |
CredentialWithSecrets | credentialWithSecrets | The credential to be added. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown when |
Remarks
The application can store up to 32 credentials, and each credential must have a unique label. See Label for more information on encodings and requirements.
To list the credentials currently stored in the application, use ListCredentialsCommand.
The caller is responsible for controlling the buffer which holds the management key, and should overwrite the data after the command is sent. The user's manual entry "Sensitive Data" has further details and recommendations for handling this kind of data.