Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hotp ¶
type Hotp struct { Secret string Count int Length int Window int IsBase32 bool Hasher func() hash.Hash }
Hotp is a struct holding the details for a hmac-sha1 otp
func (Hotp) Check ¶
Check validates an HOTP accepts secret, count, length to generate the OTP's to validate an incoming OTP, and how many times to increase the validation count
type HotpConfig ¶
type HotpConfig struct { Secret string Count int Length int Window int UseBase32 bool Crypto string }
HotpConfig holds user friendly configurations for creating tokens using the NewHOTP function otherwise the Hotp object can be created independantly.
type Totp ¶
type Totp struct { Secret string TimeBox time.Time Length int Window int WindowSize int IsBase32 bool Hasher func() hash.Hash }
Totp is a struct holding the details for a time based hmac-sha1 otp
func NewTOTP ¶
func NewTOTP(c *TotpConfig) *Totp
NewTOTP constructor for hotp object func NewTOTP(secret string, TimeBox time.Time, length int, window int, windowSize int, isBase32 bool, hasher func() hash.Hash) *Totp {
Click to show internal directories.
Click to hide internal directories.