jwtutil

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilAlg = internal.NewError("algorithm is nil")

ErrNilAlg is the error for when an algorithm can't be resolved.

Functions

This section is empty.

Types

type Resolver

type Resolver struct {
	New func(jwt.Header) (jwt.Algorithm, error)
	// contains filtered or unexported fields
}

Resolver is an Algorithm resolver.

func (*Resolver) Name

func (rv *Resolver) Name() string

Name returns an Algorithm's name.

func (*Resolver) Resolve

func (rv *Resolver) Resolve(hd jwt.Header) error

Resolve sets an Algorithm based on a JOSE Header.

func (*Resolver) Sign

func (rv *Resolver) Sign(headerPayload []byte) ([]byte, error)

Sign returns an error since Resolver doesn't support signing.

func (*Resolver) Size

func (rv *Resolver) Size() int

Size returns an Algorithm's size.

func (*Resolver) Verify

func (rv *Resolver) Verify(headerPayload, sig []byte) error

Verify resolves and Algorithm and verifies using it.

Jump to

Keyboard shortcuts

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