jwt

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext[T any](ctx context.Context) (*T, bool)

func NewContext

func NewContext[T any](ctx context.Context, claims *T) context.Context

Types

type Signer

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

func NewSigner

func NewSigner(privateKeyPEM []byte) (*Signer, error)

func (*Signer) KID

func (s *Signer) KID() string

func (*Signer) PrivateKey

func (s *Signer) PrivateKey() *rsa.PrivateKey

func (*Signer) PublicKey

func (s *Signer) PublicKey() *rsa.PublicKey

func (*Signer) Sign

func (s *Signer) Sign(claims jwt.Claims) (string, error)

type Verifier

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

func NewVerifier

func NewVerifier() *Verifier

func (*Verifier) AddKey

func (v *Verifier) AddKey(kid string, pub *rsa.PublicKey)

func (*Verifier) Verify

func (v *Verifier) Verify(tokenString string, claims jwt.Claims) error

Jump to

Keyboard shortcuts

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