Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPasswordUsed = errors.New("the provided password has already been used")
Functions ¶
func CleanUsedTOTP ¶
func CleanUsedTOTP(password string)
CleanUsedTOTP will clear any recorded used TOTP that matches the given string.
func CleanUsedTOTPs ¶
CleanUsedTOTPs will clear all recorded used TOTPs that are older than the given age duration.
func NewKey ¶
NewKey will use the given reader to generate some random bytes to be used as the key in a one time password.
Because of this it's important that the reader be set to nil in a production environment so that internally the function can use the most secure option which will be the standard library's crypto/rand reader.
Types ¶
type HMACBased ¶
type HMACBased struct {
// contains filtered or unexported fields
}
HMACBased implements an "HMAC-based One Time Password" (HOTP) in accordance with RFC4226 and any errata.
Click to show internal directories.
Click to hide internal directories.