mfa

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientResourcePackage

func ClientResourcePackage() map[string]map[string]string

func GetSecret

func GetSecret(baseSize uint) string

Types

type FreeOtpAuthenticator2FaSha1

type FreeOtpAuthenticator2FaSha1 struct {
	Secret string `json:"secret"` //The base32NoPaddingEncodedSecret parameter is an arbitrary key value encoded in Base32 according to RFC 3548. The padding specified in RFC 3548 section 2.2 is not required and should be omitted.
	Period int64  `json:"period"` //更新周期单位秒,根据客户端程序设置,一般为:30
	Digits uint   `json:"digits"` //数字数量,根据客户端程序设置,一般为:6 到 8
	Label  string `json:"label"`  //格式为:"应用名称:账号名称"
	Issuer string `json:"issuer"` //作者信息
}

func (*FreeOtpAuthenticator2FaSha1) MakeGoogleAuthenticator

func (m *FreeOtpAuthenticator2FaSha1) MakeGoogleAuthenticator(key string, t int64) (string, error)

MakeGoogleAuthenticator 获取key&t对应的验证码 key 秘钥 t 1970年的秒

func (*FreeOtpAuthenticator2FaSha1) MakeGoogleAuthenticatorForNow

func (m *FreeOtpAuthenticator2FaSha1) MakeGoogleAuthenticatorForNow(key string) (string, error)

MakeGoogleAuthenticatorForNow 获取key对应的验证码

func (*FreeOtpAuthenticator2FaSha1) QrString

func (m *FreeOtpAuthenticator2FaSha1) QrString() (qr string)

func (*FreeOtpAuthenticator2FaSha1) VerifyCode

func (m *FreeOtpAuthenticator2FaSha1) VerifyCode(code uint32) bool

Jump to

Keyboard shortcuts

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