Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECDSAVerifier

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

func (ECDSAVerifier) Verify

func (v ECDSAVerifier) Verify(payload []byte, signature []byte, key interface{}) error

type HMACVerifier

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

func (HMACVerifier) Verify

func (v HMACVerifier) Verify(payload, signature []byte, key interface{}) (err error)

type RSAVerifier

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

func (RSAVerifier) Verify

func (v RSAVerifier) Verify(payload, signature []byte, key interface{}) error

type Verifier

type Verifier interface {
	// Verify checks whehter the payload and signature are valid for
	// the given key.
	// `key` is the key used for verifying the payload, and is usually
	// the public key associated with the signature method. For example,
	// for `jwa.RSXXX` and `jwa.PSXXX` types, you need to pass the
	// `*"crypto/rsa".PublicKey` type.
	// Check the documentation for each verifier for details
	Verify(payload []byte, signature []byte, key interface{}) error
}

func New

    New creates a new JWS verifier using the specified algorithm and the public key