Show / Hide Table of Contents

AddCredential Method

AddCredential(ReadOnlyMemory<byte>, CredentialWithSecrets)

Add a credential.

C#
public void AddCredential(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. It must be exactly 16 bytes long (see ValidManagementKeyLength).

CredentialWithSecrets credentialWithSecrets

The credential to be added.

Exceptions

Type Condition
InvalidOperationException

Either a credential with that label already exists, or there is no space to add the credential.

SecurityException

Authentication with the management key failed.

Remarks

There is a limit of 8 attempts to authenticate with the management key before the management key is blocked. Once the management key is blocked, the application must be reset before performing operations which require authentication with the management key (such as adding credentials, deleting credentials, and changing the management key). To reset the application, see ResetApplication(). Supplying the correct management key before the management key is blocked will reset the retry counter to 8.

In this article
Back to top Generated by DocFX