DevKits

JWKS Generator — Build a /.well-known/jwks.json Endpoint

Assemble multiple RSA/EC public keys into a standard JSON Web Key Set (JWKS, RFC 7517). Paste PEM (public or private — private components are stripped) or JWK, then auto-generate kid via SHA-256 thumbprint (RFC 7638). Ready to host at /.well-known/jwks.json — free, no signup, 100% local.

Last updated:

Comments

Paste one or more RSA/EC public keys (PEM or JWK). The tool builds a valid JSON Web Key Set (RFC 7517) ready to serve at /.well-known/jwks.json, auto-generating `kid` via SHA-256 thumbprint (RFC 7638). Everything runs locally.

Assemble a JWKS (JSON Web Key Set, RFC 7517) that you can host at /.well-known/jwks.json. Paste one or more RSA/EC public (or private) keys — private components are stripped automatically. Nothing is uploaded.

Key #1
0 chars · 1 lines

What is JWKS Generator?

A JWKS (JSON Web Key Set) is the standard way an auth service publishes the public keys clients need to verify JWTs it has issued. It lives at a stable URL (typically `/.well-known/jwks.json`) and contains multiple keys with unique `kid`s so the issuer can rotate keys without breaking in-flight tokens. This tool assembles the JSON envelope for you, safely stripping private components if you accidentally paste a private key.

How to build a JWKS endpoint

  1. 1Paste one or more public keys — PEM (`-----BEGIN PUBLIC KEY-----`) or JWK. You can also paste a private key; the tool strips the private components (d, p, q, dp, dq, qi) automatically.
  2. 2Optionally set `use` (`sig` for signing, `enc` for encryption) and `alg` (RS256, ES256, PS256, etc.) — most JWKS clients ignore these but they help humans reading the endpoint.
  3. 3`kid` (key ID) is auto-generated from the RFC 7638 JWK thumbprint — a stable SHA-256 hash of the key's core parameters. This makes `kid`s deterministic and reproducible across runs.
  4. 4The right pane shows the assembled `{ "keys": [ ... ] }` document. Copy or download it.
  5. 5Serve it at `https://your-domain.com/.well-known/jwks.json` with `Content-Type: application/jwk-set+json` and `Cache-Control: public, max-age=3600`.

Use Cases

Bootstrap an OIDC / OAuth issuer

Your auth service just started issuing JWTs. Every verifier needs to find your public keys — put a JWKS at `/.well-known/jwks.json` and clients look them up automatically.

Rotate signing keys with zero downtime

Add the new key alongside the old one in the JWKS. Sign new tokens with the new `kid`. Old tokens still verify against the old key. Once all old tokens expire, remove the old key from the set.

Publish keys for a federated system

Multi-tenant apps and identity federation (SAML/OIDC handshakes) rely on JWKS to advertise per-tenant keys. Each key gets a distinct `kid` so verifiers can pick the right one from the token header.

Convert legacy PEM keys to JWK

You have RSA/EC public keys in PEM lying around. Paste them here to get JWK equivalents — the format JWT libraries and browsers can consume directly.

Code Examples

Minimal JWKS example (RSA + EC)

{
  "keys": [
    {
      "kty": "RSA",
      "use": "sig",
      "alg": "RS256",
      "kid": "b1c9e4-…-thumbprint",
      "n": "0vx7agoebGcQSuuPiLJXZptN…",
      "e": "AQAB"
    },
    {
      "kty": "EC",
      "use": "sig",
      "alg": "ES256",
      "kid": "a45f1d-…-thumbprint",
      "crv": "P-256",
      "x": "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
      "y": "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM"
    }
  ]
}

Verify with jose (auto-fetch JWKS)

import { createRemoteJWKSet, jwtVerify } from "jose";

const JWKS = createRemoteJWKSet(new URL("https://issuer.example.com/.well-known/jwks.json"));
const { payload } = await jwtVerify(token, JWKS, { issuer: "https://issuer.example.com", audience: "my-api" });

Verify with PyJWT + JWKS

import jwt
from jwt import PyJWKClient

jwks = PyJWKClient("https://issuer.example.com/.well-known/jwks.json")
key = jwks.get_signing_key_from_jwt(token).key
payload = jwt.decode(token, key, algorithms=["RS256"], audience="my-api")

Key Concepts

JWK Thumbprint (RFC 7638)
A deterministic SHA-256 hash of the key's canonical JSON representation — just the essential fields, in sorted order. Because it's derived from the key material, the same key always yields the same `kid`, which is exactly what you want for stable references.
kid (key ID)
A string that both the JWT header and JWKS entry share so verifiers know which key to use. Any unique string works, but RFC 7638 thumbprints are the recommended default — they're globally unique per-key and never collide accidentally.
use vs. alg
`use` is coarse: `sig` (signing) or `enc` (encryption). `alg` is specific: `RS256`, `ES256`, `PS256`, etc. Most verifiers care only about `kty` (RSA/EC) and the key material; `use` and `alg` are hints for humans and stricter clients.
Private components
An RSA private key has `d`, `p`, `q`, `dp`, `dq`, `qi` in addition to the public `n` and `e`. An EC private key has `d` in addition to `x` and `y`. Publishing any of these to a JWKS is catastrophic — it hands attackers the ability to forge tokens. This tool strips them automatically.

Tips & Best Practices

  • ▸Serve JWKS with `Cache-Control: public, max-age=3600` (1 hour). Verifiers cache the response, so rotation propagates slowly — plan for at least a full max-age of overlap between old + new keys.
  • ▸Always publish the JWKS at `https://your-domain/.well-known/jwks.json`. That's the convention every JWT library assumes; put it elsewhere and integrations become annoying.
  • ▸Content-Type should be `application/jwk-set+json` (or plain `application/json` — most clients accept either).
  • ▸Never mix private and public keys in a JWKS. If in doubt, run the endpoint output through this tool again — pasting a JWKS with private components will surface warnings.
  • ▸For key rotation, generate the new key at least one `max-age + longest-token-TTL` before you start signing with it. That gives every cached JWKS a chance to refresh before your new tokens hit the wild.

Frequently Asked Questions

What is a JWKS and when do I need one?

A JWKS (JSON Web Key Set, RFC 7517) is a JSON document with a top-level 'keys' array of JWKs. It's the standard way to publish public keys so that clients can verify JWTs your service signed. Typical setup: your backend signs JWTs with a private key you keep secret, and hosts the matching public key(s) at /.well-known/jwks.json. Client libraries fetch that URL, cache it, and use the kid claim in each JWT to pick the right key.

What is a kid and how is it generated?

kid stands for 'Key ID' — a string identifier that lets JWT verifiers know which key to use when you rotate. This tool defaults to computing a SHA-256 JWK Thumbprint per RFC 7638, which is a deterministic hash of the public key's essential fields. Same key → same kid → clean rotation semantics. You can override with a custom string (e.g. '2026-q3', 'auth-signer-1') if you prefer.

Can I paste private keys?

Yes — the tool auto-strips private components (d, p, q, dp, dq, qi, oth) before serialising. But be careful: your private key still passes through this tool's memory. Everything is client-side and nothing is uploaded, but for production keys, prefer to paste only the public halves. Use our Public Key Extractor first if you want to be extra defensive.

What alg should I set on each key?

If you leave alg blank, the tool guesses based on key type: RSA → RS256, EC P-256 → ES256, P-384 → ES384, P-521 → ES512. Override to PS256 / PS384 / PS512 if you use RSA-PSS instead of RSASSA-PKCS1-v1_5. The alg claim is a hint to verifiers — many JWT libraries also honour it as a security check against algorithm substitution attacks.

How do I host the output?

Save the JSON as jwks.json and serve it from your web server or CDN at https://your-domain/.well-known/jwks.json with Content-Type: application/json. Set a moderate Cache-Control (5–15 minutes is typical) so verifiers can cache it but still notice rotation reasonably quickly. Most JWT libraries (jsonwebtoken, jose, node-jose, PyJWT, jose4j) have a jwksUri option that handles fetching and caching automatically.

Try Next

AES Encrypt / Decrypt

Encrypt and decrypt text with AES (128 / 192 / 256, GCM authenticated or CBC legacy) using a password. PBKDF2 key derivation with 200,000 iterations. 100% local — the Web Crypto API runs entirely in your browser.

Related Tools

Reference & Guides