Documentation
¶
Overview ¶
Package hotp implements the HOTP algorithm according to RFC 4226
Index ¶
- func Truncate(digits otp.Digits, sum []byte) string
- func WithSkew(skew int) otp.ValidationOption
- type Algorithm
- func (a *Algorithm) Digits() otp.Digits
- func (a *Algorithm) Export(exporter otp.Exporter)
- func (a *Algorithm) Generate(reference int64) string
- func (a *Algorithm) HashAlgorithm() otp.HashAlgorithm
- func (a *Algorithm) Key() []byte
- func (a *Algorithm) Validate(value string, reference int64, opts ...otp.ValidationOption) (int64, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Truncate ¶
Truncate implements the "dynamic truncation" as defined in RFC 4226 See http://tools.ietf.org/html/rfc4226#section-5.4 for details
func WithSkew ¶
func WithSkew(skew int) otp.ValidationOption
Types ¶
type Algorithm ¶
type Algorithm struct {
// contains filtered or unexported fields
}
func (*Algorithm) HashAlgorithm ¶
func (a *Algorithm) HashAlgorithm() otp.HashAlgorithm
type Option ¶
type Option func(alg *Algorithm)
func WithDigits ¶
func WithHashAlgorithm ¶
func WithHashAlgorithm(algorithm otp.HashAlgorithm) Option
Click to show internal directories.
Click to hide internal directories.