jwt

package
v0.0.0-...-c0251f4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAndVerify

func DecodeAndVerify(jwt string, payload interface{}, getPublicKey func(keyID string) (*ecdsa.PublicKey, error)) error

func EncodeAndSign

func EncodeAndSign(claims interface{}, keyID string, privateKey *ecdsa.PrivateKey) (string, error)

Types

type ClaimSet

type ClaimSet struct {
	Issuer    string   `json:"iss,omitempty"`
	Subject   string   `json:"sub,omitempty"`
	Audience  []string `json:"aud,omitempty"`
	Expiry    int64    `json:"exp,omitempty"`
	NotBefore int64    `json:"nbf,omitempty"`
	IssuedAt  int64    `json:"iat,omitempty"`
	JwtId     string   `json:"jti,omitempty"`
}

Jump to

Keyboard shortcuts

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