Documentation
¶
Index ¶
Constants ¶
View Source
const ( // HashSha256 is the sha256 hash type. HashSha256 = Hash("sha256") // HashSha1 is the sha1 hash type. HashSha1 = Hash("sha1") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator is an HMAC validator. It can be used to validate HMAC signatures for a given hash and secret. The zero value is not valid, use NewHMACValidator instead.
func NewHMACValidator ¶
NewHMACValidator returns a new HMAC validator for the given hash and secret.
func (*Validator) IsInvalid ¶
IsInvalid returns true if the signature is invalid for the given body and secret. This is a convenience method for !IsValid(body, signature) Inputs body []byte - the body to validate signature string - the signature to validate the body against
Click to show internal directories.
Click to hide internal directories.