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 数字
Click to show internal directories.
Click to hide internal directories.