Help us shape the future of Go! Take the 2026 Go Developer Survey

hmax

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2019 License: MIT, MIT Imports: 8 Imported by: 2

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL