tkn

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(tkn []byte, key interface{}, alg string) (jwt.Token, error)

Parse parses a token []byte representation and verifies it against the given key and algorithm

func WithClaims

func WithClaims(clms map[string]interface{}) option

WithClaims adds a list of claims to the token

func WithHeaders

func WithHeaders(hdrs map[string]interface{}) option

WithHeaders adds a list of headers to the token

Types

type Token

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

Token describes the internal token before signing

func New

func New(options ...option) (*Token, error)

New creates a new token instance

func (*Token) Sign

func (t *Token) Sign(key interface{}, alg string) ([]byte, error)

Sign returns []byte representation of the token signed with the given key and algorithm

Jump to

Keyboard shortcuts

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