Documentation ¶
Index ¶
- func ClientResourcePackage() map[string]map[string]string
- func GetSecret(baseSize uint) string
- type FreeOtpAuthenticator2FaSha1
- func (m *FreeOtpAuthenticator2FaSha1) MakeGoogleAuthenticator(key string, t int64) (string, error)
- func (m *FreeOtpAuthenticator2FaSha1) MakeGoogleAuthenticatorForNow(key string) (string, error)
- func (m *FreeOtpAuthenticator2FaSha1) QrString() (qr string)
- func (m *FreeOtpAuthenticator2FaSha1) VerifyCode(code uint32) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientResourcePackage ¶
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
Click to show internal directories.
Click to hide internal directories.