jwt: github.com/gbrlsnchs/jwt/jwtutil Index | Files

package jwtutil

import "github.com/gbrlsnchs/jwt/jwtutil"


Package Files



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

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

type Resolver Uses

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

Resolver is an Algorithm resolver.

func (*Resolver) Name Uses

func (rv *Resolver) Name() string

Name returns an Algorithm's name.

func (*Resolver) Resolve Uses

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

Resolve sets an Algorithm based on a JOSE Header.

func (*Resolver) Sign Uses

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

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

func (*Resolver) Size Uses

func (rv *Resolver) Size() int

Size returns an Algorithm's size.

func (*Resolver) Verify Uses

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

Verify resolves and Algorithm and verifies using it.

Package jwtutil imports 2 packages (graph). Updated 2019-10-11. Refresh now. Tools for package owners.