文件名称:otpgo:Go的基于时间的一次性密码(TOTP)和基于HMAC的一次性密码(HOTP)库
文件大小:24KB
文件格式:ZIP
更新时间:2024-05-28 08:45:22
totp hotp authenticator google-authenticator authy
otpgo Go的基于HMAC和基于时间的一次性密码(HOTP和TOTP)库。 实现和 。 内容 在Authenticator App中注册 二维码 手动注册 默认值 HOTP参数 TOTP参数 支持的运营 生成HOTP和TOTP代码。 验证HOTP和TOTP代码。 将OTP配置导出为Google Authenticator URI 。 将OTP配置导出为QR码图像(用于在身份验证器应用中注册机密)。 将OTP配置导出为JSON。 阅读材料 HOTP:基于HMAC的一次性密码算法 TOTP:基于时间的一次性密码算法 Google身份验证器密钥URI格式 浏览器身份验证器演示 用法 生成代码 生成代码的最简单方法是创建HOTP / TOTP结构并调用Generate() // // HMAC-Based // // Will use all default values
【文件预览】:
otpgo-main
----hotp_test.go(6KB)
----config()
--------algorithm_test.go(3KB)
--------algorithm.go(1KB)
--------length.go(752B)
--------length_test.go(2KB)
----error.go(245B)
----authenticator()
--------authenticator_test.go(3KB)
--------authenticator.go(2KB)
----.github()
--------workflows()
----otp.go(2KB)
----LICENSE(1KB)
----error_test.go(332B)
----totp_test.go(7KB)
----hotp.go(4KB)
----otp_test.go(1KB)
----examples()
--------hotp()
--------totp()
----.gitignore(180B)
----CHANGELOG.md(2KB)
----totp.go(4KB)
----go.sum(227B)
----README.md(6KB)
----go.mod(114B)