signer

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSigningFailed = errors.New("signing failed")
	ErrMissingSecret = errors.New("secret cannot be empty")
)

Functions

This section is empty.

Types

type SHA256Signer

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

func (*SHA256Signer) Sign

func (s *SHA256Signer) Sign(payload []byte) (string, error)

func (*SHA256Signer) Verify

func (s *SHA256Signer) Verify(payload []byte, signature string) error

type Signer

type Signer interface {
	Sign(payload []byte) (string, error)
	Verify(payload []byte, signature string) error
}

Signer is an interface for signing and verifying a payload.

func NewSHA256Signer

func NewSHA256Signer(secret []byte) (Signer, error)

Jump to

Keyboard shortcuts

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