otp

package
v0.0.0-...-61a4702 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OTPKey

type OTPKey struct {
	Issuer       string `json:"issuer"`
	Label        string `json:"label"`
	Digits       otp.Digits
	DigitsInt    int    `json:"digits"`
	OTPType      string `json:"type"`
	Algorithm    otp.Algorithm
	AlgorithmStr string   `json:"algorithm"`
	Period       int      `json:"period"`
	Tags         []string `json:"tags"`

	// Will always be empty if OTPKeysFromJSON() was used
	Secret string `json:"secret"`
	// contains filtered or unexported fields
}

OTPKey holds the structure of a single OTP key from backup

func OTPKeysFromJSON

func OTPKeysFromJSON(otpJSON []byte) ([]*OTPKey, error)

OTPKeysFromJSON parses OTP keys from andOTP JSON backup

func (*OTPKey) GenerateCode

func (k *OTPKey) GenerateCode() (string, error)

GenerateCode generates an OTP token

Jump to

Keyboard shortcuts

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