Show / Hide Table of Contents

Credential Class

Namespace: Yubico.YubiKey.Oath Assembly: Yubico.YubiKey.dll

Represents a single OATH credential.

C#
public class Credential
Inheritance object Credential

Remarks

The credential can be a TOTP (Time-based One-time Password) or a HOTP (HMAC-based One-time Password).

Constructors

Name Description
Credential()

Constructs an instance of the Credential class.

Credential(string?, string, CredentialPeriod, CredentialType, HashAlgorithm)

Constructs an instance of the Credential class for List Command.

Credential(string?, string, CredentialType, CredentialPeriod)

Constructs an instance of the Credential class for CalculateAllCommand.

Credential(string?, string, CredentialType, HashAlgorithm, string, CredentialPeriod, int, int?, bool)

Constructs an instance of the Credential class for PutCommand.

Properties

Name Description
AccountName

The account name, which is typically the user's email address.

Algorithm

The hash algorithm used by the credential.

Counter

Counter value for HOTP.

Digits

The number of digits in a one-time password. The value for this property can only be 6, 7 or 8.

IsValidNameLength

Checks the name length, which cannot be more than 64 bytes in UTF-8 encoding.

Issuer

The provider or the service the account is associated with.

Name

Get-property witch serves as the unique identifier for the credential.

Period

The validity period in seconds for TOTP code. It can only be 15, 30 or 60 seconds. For HOTP should be set to zero.

RequiresTouch

The credential requires the user to touch the key to generate a one-time password.

Secret

The secret is an arbitrary value encoded in Base32 according to RFC 3548.

Type

The type of the credential. Indicates the type of the credential as either HOTP or TOTP.

Methods

Name Description
Equals(object)
Equals(Credential?)
GetHashCode()
ParseUri(Uri)

Parses an 'otpauth://' Uri that received from QR reader or manually from server.

Operators

Name Description
operator ==(Credential, Credential)
operator !=(Credential, Credential)
In this article
Back to top Generated by DocFX