jwtlib

package
v1.0.44 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEd25519

func IsEd25519(flagAlg string) bool

func IsEs

func IsEs(flagAlg string) bool

func IsHs

func IsHs(flagAlg string) bool

func IsRs

func IsRs(flagAlg string) bool

func LoadData

func LoadData(fn string) ([]byte, error)

LoadData will read input from specified file or stdin if file name is '-'

func PrintErrorJson

func PrintErrorJson(js string, err error) (rv string)

func PrintJSON

func PrintJSON(data interface{}, indent bool, fp *os.File)

PrintJSON will print a json object as an indendent or not JSON string.

func SignToken

func SignToken(rawToken []byte, Alg string, Head map[string]string, claims jwt.MapClaims, keyData []byte) (signedToken string, err error)

func SignToken(rawToken []byte, Alg string, Head ArgList, claims jwt.MapClaims, keyData []byte) (err error) {

keyData is the private key if EC/RS etc. It is the secret hash if HS256, HS384.

func TrimWhitespaceBytes

func TrimWhitespaceBytes(tokData []byte) (rv []byte)

func VerifyToken

func VerifyToken(rawToken []byte, alg string, keyData []byte) (token *jwt.Token, err error)

xtoken, err := jwtlib.VerifyToken ( tokData , Alg, PublicKey )

if ES*, PS*, RS*, Ed25519 - then key is the public key. if HS then key is just the single value (same as private key).

Types

This section is empty.

Jump to

Keyboard shortcuts

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