jwtlib

package
v0.0.0-...-554d062 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewToken

func NewToken(key []byte) (*jwt.Token, error)

NewToken creates a new jwt from the given key.

func VerifyClaims

func VerifyClaims(key []byte, tokenBytes []byte) error

VerifyClaims verifies that the token claims are valid.

Types

type HSAlg

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

func NewSignerHS

func NewSignerHS(key []byte) HSAlg

func NewVerifierHS

func NewVerifierHS(key []byte) HSAlg

func (*HSAlg) Algorithm

func (hs *HSAlg) Algorithm() jwtlib.Algorithm

func (*HSAlg) Sign

func (hs *HSAlg) Sign(payload []byte) ([]byte, error)

func (*HSAlg) SignSize

func (hs *HSAlg) SignSize() int

func (*HSAlg) Verify

func (hs *HSAlg) Verify(token jwtlib.Token) error

type TokenErr

type TokenErr string
const ErrInvalidToken TokenErr = "the token payload is not valid"

ErrInvalidToken is returned when a token is not valid.

func (TokenErr) Error

func (e TokenErr) Error() string

Jump to

Keyboard shortcuts

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