Documentation ¶
Overview ¶
Package hmac is the default implementation for generating and validating challenges. It uses HMAC-SHA256 to generate and validate challenges.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HMACStrategy ¶
HMACStrategy is responsible for generating and validating challenges.
func (*HMACStrategy) Generate ¶
func (c *HMACStrategy) Generate() (string, string, error)
Generate generates a token and a matching signature or returns an error. This method implements rfc6819 Section 5.1.4.2.2: Use High Entropy for Secrets.
func (*HMACStrategy) Signature ¶
func (c *HMACStrategy) Signature(token string) string
func (*HMACStrategy) Validate ¶
func (c *HMACStrategy) Validate(token string) error
Validate validates a token and returns its signature or an error if the token is not valid.
Click to show internal directories.
Click to hide internal directories.