Show / Hide Table of Contents

RemoveCredential Method

RemoveCredential(Credential)

Removes an existing credential from the YubiKey.

C#
public void RemoveCredential(Credential credential)

Parameters

Type Name Description
Credential credential

The Credential to remove from the YubiKey.

Exceptions

Type Condition
ArgumentNullException

Provided credential is null.

InvalidOperationException

There is no KeyCollector loaded if the authentication is required or the DeleteCommand failed.

SecurityException

Unable to verify password either because KeyCollector was canceled by the user or an incorrect password was provided if authentication is required.

RemoveCredential(string?, string, CredentialType, CredentialPeriod)

Removes an existing credential from the YubiKey.

C#
public Credential RemoveCredential(string? issuer, string account, CredentialType type = CredentialType.Totp, CredentialPeriod period = CredentialPeriod.Period30)

Parameters

Type Name Description
string issuer

The issuer is an optional string indicating the provider or service.

string account

The account name that usually is the user's email address.

CredentialType type

Indicates the CredentialType of the credential as either HOTP or TOTP. The default value is TOTP.

CredentialPeriod period

Indicates the CredentialPeriod of the credential in seconds for TOTP code. It can only be 15, 30, or 60 seconds. For HOTP should be set to zero (Undefined). The default value is 30.

Returns

Credential

The Credential that was removed from the YubiKey.

Exceptions

Type Condition
InvalidOperationException

There is no KeyCollector loaded if the authentication is required, the DeleteCommand failed, or the provided account, type, or period is invalid.

SecurityException

Unable to verify password either because KeyCollector was canceled by the user or an incorrect password was provided if authentication is required.

In this article
Back to top Generated by DocFX