totp

package
v0.0.0-...-2f2cf7e Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Algorithms = map[string]otp.Algorithm{
	"":       otp.AlgorithmSHA1,
	"SHA1":   otp.AlgorithmSHA1,
	"SHA256": otp.AlgorithmSHA256,
	"SHA512": otp.AlgorithmSHA512,
	"MD5":    otp.AlgorithmMD5,
}
View Source
var ErrUnknownAlgorithm = errors.New("totp error unknown algorithm")

Functions

This section is empty.

Types

type Service

type Service struct {
	Issuer         string
	PeriodInSecond uint
	SecretSize     uint
	Algorithm      string
}

func (*Service) GenerateKey

func (s *Service) GenerateKey(account string) (string, error)

func (*Service) Validate

func (s *Service) Validate(code string, key string) (bool, error)

Jump to

Keyboard shortcuts

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