CalculateCredential Method
CalculateCredential(Credential, ResponseFormat)
Gets an OTP (One-Time Password) value for the specific credential on the YubiKey.
public Code CalculateCredential(Credential credential, ResponseFormat responseFormat = ResponseFormat.Truncated)
Parameters
Type | Name | Description |
---|---|---|
Credential | credential | The Credential on the YubiKey to calculate. |
ResponseFormat | responseFormat | Full or truncated ResponseFormat to receive back. The default value is Truncated. |
Returns
The Code for the requested credential.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Provided credential is null. |
InvalidOperationException | There is no |
SecurityException | Unable to verify password either because |
CalculateCredential(string?, string, CredentialType, CredentialPeriod, ResponseFormat)
Gets an OTP code for the specific credential.
public Code CalculateCredential(string? issuer, string account, CredentialType type, CredentialPeriod period, ResponseFormat responseFormat = ResponseFormat.Truncated)
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. |
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). |
ResponseFormat | responseFormat | Full or truncated ResponseFormat to receive back. The default value is Truncated. |
Returns
The Code for the requested credential.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | There is no |
SecurityException | Unable to verify password either because |