AddCredential Method
AddCredential(ReadOnlyMemory<Byte>, CredentialWithSecrets)
Add a credential.
public void AddCredential(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. It must be exactly 16 bytes long (see ValidManagementKeyLength). |
CredentialWithSecrets | credentialWithSecrets | The credential to be added. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Either a credential with that label already exists, or there is no space to add the credential. |
System.Security.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.