google_auth

package
v0.0.0-...-867a071 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppSecret = "ssh2a_secret"
)

Variables

View Source
var Base32NoPaddingEncodedSecretFunc = func(privateSecret string) string {
	return base32.StdEncoding.WithPadding(
		base32.NoPadding,
	).EncodeToString(
		[]byte(AppSecret + privateSecret),
	)
}

Functions

This section is empty.

Types

type GoogleAuthenticator2FaSha1

type GoogleAuthenticator2FaSha1 struct {
	Base32NoPaddingEncodedSecret string //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.
	ExpireSecond                 uint64 //更新周期单位秒
	Digits                       int    //数字数量
}

GoogleAuthenticator2FaSha1 只实现google authenticator sha1

func (*GoogleAuthenticator2FaSha1) QrString

func (m *GoogleAuthenticator2FaSha1) QrString(label, issuer string) (qr string)

QrString google authenticator 扫描二维码的二维码字符串

func (*GoogleAuthenticator2FaSha1) Totp

func (m *GoogleAuthenticator2FaSha1) Totp() (code string, err error)

Totp 计算Time-based One-time Password 数字

Jump to

Keyboard shortcuts

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