Documentation

Index

Constants

View Source
const Version = "v1.1.0"

    Version of hmax

    Variables

    This section is empty.

    Functions

    func Sign

    func Sign(secret, message []byte) string

    func SignRequest

    func SignRequest(req *http.Request, secret []byte) error

    func Verify

    func Verify(signature string, secret, message []byte) bool

    func VerifyRequest

    func VerifyRequest(req *http.Request, secret []byte) (bool, error)

    Types

    type HMAX

    type HMAX struct {
    	Header string
    	Hasher func() hash.Hash
    	Secret []byte
    }

    func New

    func New(h string, s []byte) HMAX

    func (HMAX) Sign

    func (h HMAX) Sign(message []byte) string

    func (HMAX) SignRequest

    func (h HMAX) SignRequest(req *http.Request) error

    func (HMAX) Verify

    func (h HMAX) Verify(signature string, message []byte) (bool, error)

    func (HMAX) VerifyRequest

    func (h HMAX) VerifyRequest(req *http.Request) (bool, error)