Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Validate ¶
Validate a HOTP passcode given a counter and secret. This is a shortcut for ValidateCustom, with parameters that are compataible with Google-Authenticator.
func ValidateCustom ¶
func ValidateCustom(passcode string, counter uint64, secret string, opts ValidateOpts) (bool, error)
ValidateCustom validates an HOTP with customizable options. Most users should use Validate().
Types ¶
type GenerateOpts ¶
type GenerateOpts struct { // Name of the issuing Organization/Company. Issuer string // Name of the User's Account (eg, email address) AccountName string // Size in size of the generated Secret. Defaults to 10 bytes. SecretSize uint // Digits to request. Defaults to 6. Digits otp.Digits // Algorithm to use for HMAC. Defaults to SHA1. Algorithm otp.Algorithm }
GenerateOpts provides options for .Generate()
Click to show internal directories.
Click to hide internal directories.