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)
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 |
---|---|
System.ArgumentNullException | Provided credential is null. |
System.InvalidOperationException | There is no |
System.Security.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)
Parameters
Type | Name | Description |
---|---|---|
System.String | issuer | The issuer is an optional string indicating the provider or service. |
System.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 |
---|---|
System.InvalidOperationException | There is no |
System.Security.SecurityException | Unable to verify password either because |