Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TOTPDevice ¶
type TOTPDevice struct {
// contains filtered or unexported fields
}
TOTPDevice creates a new TOTP device.
func NewTOTPDevice ¶
func NewTOTPDevice(secret string) *TOTPDevice
NewTOTPDevice returns a new TOTPDevice with the given secret.
The secret should be a base32 encoded value.
func (*TOTPDevice) Generate ¶
func (d *TOTPDevice) Generate() (*string, error)
Generate return the current OTP.
func (*TOTPDevice) GenerateAt ¶
func (d *TOTPDevice) GenerateAt(ts int64) (*string, error)
GenerateAt returns the OTP for the given timestamp.
Click to show internal directories.
Click to hide internal directories.