Documentation
¶
Overview ¶
Package totp holds the recovery-code format helpers and an RFC 6238 code generator the auth engine and its tests share. Verification and secret handling live in the auth library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCode ¶
GenerateCode returns the 6-digit TOTP for secretBase32 at the step containing now, with no clock-skew tolerance (that's Validate's job, which calls this internally): the symmetric counterpart callers need wherever something other than a live authenticator app must produce a code, e.g. tests exercising the confirm/verify handlers end to end.
func GenerateRecoveryCode ¶
GenerateRecoveryCode returns one single-use fallback code: 80 random bits, base32-encoded, grouped into four hyphenated blocks of four characters for readability when typed by hand.
func NormalizeRecoveryCode ¶
NormalizeRecoveryCode strips whitespace and hyphens and uppercases a recovery code, so a user's re-typed or copy-pasted input matches regardless of formatting differences from GenerateRecoveryCode's own output.
Types ¶
This section is empty.