otp

package
v1.15.15 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 13 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrOathOTP is returned when the secret is not a valid OATH secret.
	ErrOathOTP = fmt.Errorf("QR codes can only be generated for OATH OTPs")
	// ErrType is returned when the secret is not a valid OTP type.
	ErrType = fmt.Errorf("type assertion failed")
)

Functions

func Calculate

func Calculate(name string, sec gopass.Secret) (*otp.Key, error)

Calculate will compute a OTP code from a given secret.

func ParseScreen added in v1.15.6

func ParseScreen(ctx context.Context) (string, error)

ParseScreen will attempt to parse all available screen and will look for otpauth QR codes. It returns the first one it has found.

func WriteQRFile

func WriteQRFile(key *otp.Key, file string) error

WriteQRFile writes the given OTP code as a QR image to disk.

Types

This section is empty.

Jump to

Keyboard shortcuts

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