jwtutil

package
v0.0.0-...-a85b10e Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSigned

func NewSigned(jwkString string, claims Claims) (string, error)

NewSigned generates a new signed JWT that signed by specified private jwk and claims

func UnsafeClaims

func UnsafeClaims(jwtString string, dest *Claims) error

UnsafeClaims de-serializes the claims of a JWT into the dest. For signed JWTs, the claims are not verified. This function won't work for encrypted JWTs.

func Verify

func Verify(jwtString, jwkSetString string, dest *Claims) error

Verify and de-serialize a JWT into dest using the provided JWK-Set

Types

type Claims

type Claims struct {
	Standard *jwt.Claims
	Custom   map[string]interface{}
}

Claims holds standard and custom claims

func (Claims) MarshalJSON

func (c Claims) MarshalJSON() ([]byte, error)

MarshalJSON implements json.marshaler

func (*Claims) UnmarshalJSON

func (c *Claims) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

Jump to

Keyboard shortcuts

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