totp

package
v0.0.0-...-5eebb81 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package totp implements the TOTP algorithm according to RFC 6238

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithSkew

func WithSkew(skew int) otp.ValidationOption

Types

type Algorithm

type Algorithm struct {
	hotp.Algorithm
	// contains filtered or unexported fields
}

func New

func New(key []byte, opts ...Option) *Algorithm

func (*Algorithm) Export

func (a *Algorithm) Export(exporter otp.Exporter)

func (*Algorithm) Generate

func (a *Algorithm) Generate(reference int64) string

func (*Algorithm) Step

func (a *Algorithm) Step() time.Duration

func (*Algorithm) T0

func (a *Algorithm) T0() int64

func (*Algorithm) Validate

func (a *Algorithm) Validate(value string, reference int64, opts ...otp.ValidationOption) (int64, error)

type Option

type Option func(alg *Algorithm)

func WithDigits

func WithDigits(digits otp.Digits) Option

func WithHashAlgorithm

func WithHashAlgorithm(algorithm otp.HashAlgorithm) Option

func WithT0

func WithT0(t0 int64) Option

func WithTimeStep

func WithTimeStep(step time.Duration) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL