Skip to content
Security
Agent

packages

<!-- Agent-consumed file. Keep terse, unambiguous, machine-parseable. -->

From plugin
jwx
2.4k9 skills9 agents

Claude Code

> /plugin marketplace add lestrrat-go/jwx
> /plugin install jwx-dev-v4@jwx-v4

Agent definition

packages.md

<!-- Agent-consumed file. Keep terse, unambiguous, machine-parseable. -->

Package Map

Module: `github.com/lestrrat-go/jwx/v4` — flat layout, no physical `v3/` directory.

jwx (root)

Format detection and process-global settings (JSON decoder + base64 backend).

  • **GuessFormat(payload []byte) FormatKind** — heuristic detection of JWE/JWS/JWK/JWKS/JWT
  • **Settings(options ...GlobalOption)** — configure global settings (JSON, base64)
  • **WithUseNumber(v bool) GlobalOption** — decode JSON numbers as `json.Number` instead of `float64`
  • **WithBase64Encoder(v Base64Encoder) GlobalOption** — replace the process-global base64 encoder (default: `encoding/base64.RawURLEncoding`)
  • **WithBase64Decoder(v Base64Decoder) GlobalOption** — replace the process-global base64 decoder (default: variant-detecting decoder)
  • Key types: `FormatKind` (InvalidFormat, UnknownFormat, JWE, JWS, JWK, JWKS, JWT), `GlobalOption`, `Base64Encoder` (alias of `internal/base64.Encoder`), `Base64Decoder` (alias of `internal/base64.Decoder`)
  • Files: `jwx.go`, `format.go`, `options.go`, `base64.go`

jwa/

Algorithm identifiers per RFC 7518. Registry pattern with thread-safe lookup.

  • Algorithm types: `SignatureAlgorithm`, `KeyEncryptionAlgorithm`, `ContentEncryptionAlgorithm`, `EllipticCurveAlgorithm`, `KeyType`, `CompressionAlgorithm`
  • **KeyAlgorithmFrom(v any) (KeyAlgorithm, error)** — convert string/typed algorithm to union interface
  • Per-type API: `New{Type}()`, `Lookup{Type}(name) (T, bool)`, `Register{Type}()`, `Unregister{Type}()`, `{Type}s() []T`

`Register{Type}()` is process-global; attempts to replace builtin identifiers such as `RS256` return an error.

  • Constructor functions: `ES256()`, `RS256()`, `A128GCM()`, `P256()`, `Ed25519()`, etc.
  • **MLDSA44()**, **MLDSA65()**, **MLDSA87()** — ML-DSA signature algorithms (FIPS 204). Go 1.27 and later only; `jwa/signature_go127_gen.go` is `//go:build go1.27` because `crypto/mldsa` lands in Go 1.27. Generated from the three `build_constraint: go1.27` entries in `objects.yml`, and registered as builtins from that file's `init()`.
  • Files: `jwa.go` + generated `*_gen.go` (including `signature_go127_gen.go`, go1.27)
  • Imports: internal/tokens

jwk/

JSON Web Keys per RFC 7517. Key representation, parsing, import/export, caching.

  • **Settings(options ...GlobalOption)** — configure global jwk behavior (`WithStrictKeyUsage`, RSA validation floors)
  • **Parse(src []byte, ...ParseOption) (Set, error)** / **ParseKey(data []byte, ...ParseOption) (Key, error)** / **ParseKeyAs[T Key](data []byte, ...ParseOption) (T, error)** — parse JWK/JWKS; `ParseKeyAs` returns [`KeyTypeMismatchError`] on generic-type mismatch
  • **Fetcher** — transport-neutral interface implemented by companion modules such as

`github.com/jwx-go/jwkfetch/v4`

  • **Import[T Key](raw any) (T, error)** / **Export[T any](key Key) (T, error)** / **ExportAll[T any](set Set) ([]T, error)** — convert between Go crypto types and JWK (generic). `ExportAll` exports every key in a `Set`, preserving order; `T = any` handles heterogeneous sets.
  • **PublicKeyOf(v any) (Key, error)** / **PublicSetOf(v Set, ...PublicSetOption) (Set, error)** — extract public keys. `PublicSetOf` rejects sets containing symmetric (oct) keys by default (pass `WithAllowSymmetric(true)` for legacy pass-through) and rejects sets containing `UnsupportedKey` placeholders (pass `WithOmitUnsupportedKeys(true)` to drop them).
  • **AssignKeyID(key Key, ...AssignKeyIDOption) error** — compute and set kid via thumbprint
  • PEM output moved to `jwkbb.EncodePEM(keys ...any)`; unwrap via `jwk.Export[any]` / `jwk.ExportAll[any]` first
  • Global options: `WithStrictKeyUsage(bool)`, `WithMinRSAModulusBits(int)`, `WithMinRSAPublicExponent(int)`, `WithRejectSmallOrderEd25519Keys(bool)` (global only, default false; when true jwk parse/import/`Validate()` and `jws.Verify` with a raw `ed25519.PublicKey` reject small-order Ed25519 keys; backed by `internal/okp`), `WithMaxKeys(int)` (also accepted as a per-call `ParseOption`; caps `"keys"` array + PEM block count at 1000 by default), `WithStrictKeySetParsing(bool)` (also a per-call `ParseOption`; when true a `"keys"` entry that fails to parse fails the whole set — default false retains it as an `UnsupportedKey` placeholder per RFC 7517 §5; an explicit per-call option beats the global setting, so per-call `WithIgnoreParseError(true)` selects drop mode under a global strict unless the same call passes an explicit strict true)
  • HTTP JWK Set retrieval + caching moved to `github.com/jwx-go/jwkfetch` — see [Extension Modules](../../docs/10-extensions.md)
  • Key interfaces: `Key`, `Set`, `RSAPublicKey`, `RSAPrivateKey`, `ECDSAPublicKey`, `ECDSAPrivateKey`, `OKPPublicKey`, `OKPPrivateKey`, `SymmetricKey`, `AKPPublicKey`, `AKPPrivateKey` (post-quantum, used by mldsa/mlkem extensions), `UnsupportedKey` (placeholder for an unparseable JWK Set entry; embeds `Key`, adds `Reason() error`, sealed by an unexported marker method so only this package's placeholder implements it; only `kid`/`kty`/`alg` accessible best-effort, other accessors report absent; crypto ops error, `Validate()` failure satisfies `IsKeyValidationError`, `MarshalJSON` re-emits the original entry JSON; check with `IsUnsupportedKey(Key) bool`)
  • **Set.All()** / **Set.Fields()** — snapshot iterators; take a shallow copy when each iteration starts and release the set lock before yielding. Set mutation during iteration is allowed; key objects and field values are not cloned. NEVER use inside jwx; see AGENTS.md "Internal Loops".
  • Extension: `RegisterCustomField[T]()`, `RegisterCustomDecoder[T]()`, `RegisterKeyParser()`, `RegisterKeyImporter()`, `RegisterKeyExporter()`
  • Error sentinels: `ImportError()`, `ParseError()`, `ContinueError()`
  • Files: `jwk.go`, `set.go`, `parser.go`, `convert.go`, `fetcher.go`, `interface.go`, `errors.go`, `x509.go`,

`filter.go`, `rsa.go`, `ecdsa.go`, `okp.go`, `symmetric.go`, `akp.go`, `mldsa.go` (go1.27; `crypto/mldsa` importer

Read more
@lestrrat-go
Ships withjwx

Go module implementing various JWx (JWA/JWE/JWK/JWS/JWT, otherwise known as JOSE) technologies. If you are using this module in your product or your company, please add your product and/or company name in the Wiki! It really helps keeping up our motivation.

2.4k2 skills9 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
2.4k
Star history of lestrrat-go/jwx on GitHub, a chart by star-history.com

Other agents on jwx.

companion-template-sync

companion-template-syn…

Agent

Pull newest GitHub Actions versions from companion repos back into `.companions/templates/`. Dependabot updates each companion…

@lestrrat-go@lestrrat-goInstall Agent
companions

companions

Agent

Extension modules under `github.com/jwx-go/*` (asmbase64, compsig, ed448, es256k, examples, jwkfetch, jwxfilter, jwxmigrate,…

@lestrrat-go@lestrrat-goInstall Agent
internals

internals

Agent

<!-- Agent-consumed file. Keep terse, unambiguous, machine-parseable. -->

@lestrrat-go@lestrrat-goInstall Agent
release

release

Agent

How to release a new version on a `develop/v*` → `v*` line (e.g. v3.1.0). Assumes all code and changelog entries are already on…

@lestrrat-go@lestrrat-goInstall Agent

More agents from other plugins.

dependency-review

dependency-review

Agent

<!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. --> <!--…

@nvidia@nvidiaInstall Agent
0-preflight

0-preflight

Agent

Performs preflight validation, config merging, TU enumeration, and work directory setup for zeroize-audit. Produces…

skills10d8.2k
@trailofbits@trailofbitsInstall Agent
autopilot

autopilot

Agent

Autonomous hunt loop agent. Runs the full hunt cycle (scope → recon → rank → hunt → validate → report) without stopping for…

@awarexone@awarexoneInstall Agent
autopilot

autopilot

Agent

Autonomous hunt loop agent. Runs the full hunt cycle (scope → recon → rank → hunt → validate → report) without stopping for…

@shuvonsec@shuvonsecInstall Agent

Questions about packages.

Which coding agents can use packages?
packages installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.