jwt

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 11 Imported by: 0

README

jwt-go

JWT (compact) encoder & decoder

Documentation

Index

Constants

View Source
const (
	AlgHS256 string = "HS256"
	AlgHS384 string = "HS384"
	AlgHS512 string = "HS512"
)

Variables

This section is empty.

Functions

func Decode

func Decode(token string, secret []byte) ([]byte, error)

func Encode

func Encode(header JoseHeader, payload []byte, secret []byte) (string, error)

func ExtractKeyId

func ExtractKeyId(token string) (string, error)

Types

type JoseHeader

type JoseHeader struct {
	Alg     string `json:"alg"`
	KeyID   string `json:"kid"`
	KeyType string `json:"typ"`
}

func (JoseHeader) Encode

func (header JoseHeader) Encode() string

func (JoseHeader) GetHashFn

func (header JoseHeader) GetHashFn() (func() hash.Hash, error)

Jump to

Keyboard shortcuts

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