Documentation
¶
Overview ¶
Package otpcode is the TOTP arithmetic shared by every second step (a User's Second factor, ADR 0020, and a Staff member's TOTP, ADR 0026): new keys with their QR code, and matching a submitted code against a secret at a clock. It holds no state: each caller stores the last accepted time step itself and makes the conditional write that makes a code single-use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Key ¶
type Key struct {
Secret string // base32 key
URI string // otpauth:// URI
QRCode string // PNG data URI of the URI
}
Key is a freshly generated TOTP secret, shown so it can be added to an app.
func FromSecret ¶
FromSecret rebuilds the Key of an existing base32 secret, so a pending enrolment can be shown again unchanged.
Click to show internal directories.
Click to hide internal directories.