signer

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

request-signer

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSignature = errors.New("signature is invalid")
)

Functions

This section is empty.

Types

type Interface

type Interface interface {
	GenerateKeys() error
	Sign([]byte, uint64) string
	Verify(uint64, []byte, string) error
}

type RequestSigner

type RequestSigner struct {
	// contains filtered or unexported fields
}

func New

func New(publicKeyPath, privateKeyPath string) (RequestSigner, error)

func (RequestSigner) GenerateKeys

func (r RequestSigner) GenerateKeys() error

func (RequestSigner) Sign

func (r RequestSigner) Sign(payload []byte, timestamp uint64) string

func (RequestSigner) Verify

func (r RequestSigner) Verify(timestamp uint64, payload []byte, signature string) error

Jump to

Keyboard shortcuts

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