A JWK (JSON Web Key) is a JSON object representing a cryptographic key. A JWK Set is a JSON object with a `keys` array of JWKs — the standard format for publishing and exchanging multiple public keys (RFC 7517 §2).
**Common parameters** (RFC 7517 §4):
| Parameter | Required | Meaning |
|-----------|----------|---------|
| `kty` | MUST | Key type family: `"RSA"`, `"EC"`, `"oct"` |
| `kid` | OPTIONAL | Key identifier — used to select among multiple keys during rotation |
| `use` | OPTIONAL | Intended use: `"sig"` (signature) or `"enc"` (encryption) |
| `key_ops` | OPTIONAL | Permitted operations: `sign`, `verify`, `encrypt`, `decrypt`, `wrapKey`, etc. |
| `alg` | OPTIONAL | Intended algorithm (narrows acceptable algorithms for this key) |
**Key type-specific fields** (defined in RFC 7518):
- **RSA**: `n` (modulus), `e` (public exponent); add `d`, `p`, `q` for private key
- **EC**: `crv` (curve), `x`, `y` (public coordinates); add `d` for private key
- **Symmetric**: `k` (key value)
**Key rotation**: `kid` values in JWK Sets must be distinct (§4.5). A `kid` in a JWS/JWE header identifies which key to use for verification — enabling zero-downtime rotation by publishing old and new keys simultaneously before retiring the old one.
**Security** (§9): Private/symmetric JWKs must be encrypted via JWE with `"cty": "jwk+json"`. Trust depends on key provenance, not key material alone.
**Cross-domain applications**:
- **OIDC/OAuth**: Authorization servers publish JWKS at `/.well-known/jwks.json`; clients fetch to verify ID tokens
- **OpenID Federation**: Entity Configurations embed JWKS inline; rotation is self-managed without CA involvement
- **mTLS alternatives**: JWKS-based key pinning replaces certificate pinning in service-to-service auth
## Source
RFC 7517 — JSON Web Key (IETF, May 2015): https://datatracker.ietf.org/doc/html/rfc7517
---
*Source: [[RFC 7517 — JSON Web Key]]*