jwx

package
v6.2.13 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultContentEncryptionAlgorithm = jwa.A256GCM()
View Source
var DefaultEcEncryptionAlgorithm = jwa.ECDH_ES_A256KW()
View Source
var DefaultRsaEncryptionAlgorithm = jwa.RSA_OAEP_256()
View Source
var ErrUnsupportedSigningKey = errors.New("signing key algorithm not supported")

ErrUnsupportedSigningKey is returned when an unsupported private key is used to sign. Currently only ecdsa and rsa keys are supported

View Source
var SupportedAlgorithms = []jwa.SignatureAlgorithm{jwa.ES256(), jwa.EdDSA(), jwa.ES384(), jwa.ES512(), jwa.PS256(), jwa.PS384(), jwa.PS512()}

Functions

func AddSupportedAlgorithm

func AddSupportedAlgorithm(alg jwa.SignatureAlgorithm) bool

func ClaimsAsMap

func ClaimsAsMap(token jwt.Token) (map[string]interface{}, error)

ClaimsAsMap returns a JWT token's claims as a map, keyed by their JSON member names.

It replaces jwx v2's token.AsMap, which was removed in v3. Marshaling via JSON (rather than iterating keys and calling Get per claim) is deliberate: v3's per-field Get returns an error for a null-valued claim, whereas the JSON round-trip preserves null claims as nil - matching v2's AsMap behaviour and avoiding rejection of otherwise-valid tokens.

func IsAlgorithmSupported

func IsAlgorithmSupported(alg jwa.SignatureAlgorithm) bool

func SupportedAlgorithmsAsStrings

func SupportedAlgorithmsAsStrings() []string

SupportedAlgorithmsAsStrings returns the supported algorithms as a slice of strings

Types

This section is empty.

Jump to

Keyboard shortcuts

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