Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultContentEncryptionAlgorithm = jwa.A256GCM()
var DefaultEcEncryptionAlgorithm = jwa.ECDH_ES_A256KW()
var DefaultRsaEncryptionAlgorithm = jwa.RSA_OAEP_256()
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
Functions ¶
func AddSupportedAlgorithm ¶
func AddSupportedAlgorithm(alg jwa.SignatureAlgorithm) bool
func ClaimsAsMap ¶
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.