Show / Hide Table of Contents

AddCredentialCommand Constructor

AddCredentialCommand(ReadOnlyMemory<byte>, CredentialWithSecrets)

Add a credential to the YubiHSM Auth application.

C#
public AddCredentialCommand(ReadOnlyMemory<byte> managementKey, CredentialWithSecrets credentialWithSecrets)

Parameters

Type Name Description
ReadOnlyMemory<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
ArgumentOutOfRangeException

Thrown when managementKey has an invalid length.

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.

In this article
Back to top Generated by DocFX