Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HmacAlgorithm ¶
type HmacAlgorithm int
HmacAlgorithm type describes the supported hash algorithms for usage in OTP generation.
const ( // HmacSHA1 indicates to use the SHA1 hash to calculate an HMAC. HmacSHA1 HmacAlgorithm = iota + 1 // HmacSHA256 indicates to use the SHA256 hash to calculate an HMAC. HmacSHA256 // HmacSHA512 indicates to use the SHA512 hash to calculate an HMAC. HmacSHA512 )
func (HmacAlgorithm) Hash ¶
func (alg HmacAlgorithm) Hash() (h hash.Hash)
Hash returns a hash.Hash instance corresponding to the HmacAlgorithm type.
func (HmacAlgorithm) MarshalJSON ¶
func (alg HmacAlgorithm) MarshalJSON() ([]byte, error)
MarshalJSON returns a JSON representation of HmacAlgorithm.
func (HmacAlgorithm) String ¶
func (alg HmacAlgorithm) String() string
String returns a string representation of HmacAlgorithm.
type Length ¶
type Length int
Length type describes the recommended OTP lengths.
const ( Length1 Length = iota + 1 Length2 Length3 Length4 Length5 Length6 Length7 Length8 Length9 Length10 )
Supported length to the OTP generated using HOTP or TOTP.
Click to show internal directories.
Click to hide internal directories.