Documentation ¶
Overview ¶
Package alg_hmac provides signer and verifier for HMAC digests using hmac-sha256
Index ¶
Constants ¶
View Source
const HMAC_SHA256 = "hmac-sha256" // Algo is the HMAC algorithm name
Variables ¶
This section is empty.
Functions ¶
func NewMultiHMACKeyDirectory ¶
func NewMultiHMACKeyDirectory(keys map[string]HMAC) verifier.KeyDirectory
NewMultiHMACKeyDirectory creates a new in-memory MultiHMACKeyDirectory with the provided map of keyID to HMAC
GetKey() will validate the algorithm and return the HMAC if it is found
func NewSingleHMACKeyDirectory ¶
func NewSingleHMACKeyDirectory(hmac *HMAC) verifier.KeyDirectory
NewSingleHMACKeyDirectory creates a new in-memory SingleHMACKeyDirectory with the provided key. All parameters are ignored in the GetKey() method, and it will never error.
Types ¶
type HMAC ¶
HMAC is a signer and verifier for HMAC digests. It uses crypto/hmac with sha256, and implements the httpsig.Attributer interface
func NewHMACWithAttributes ¶
NewHMACWithAttributes creates a new HMAC with the provided key and attributes
func (*HMAC) Attributes ¶
func (*HMAC) ContentDigest ¶
func (h *HMAC) ContentDigest() contentdigest.Digester
Click to show internal directories.
Click to hide internal directories.