JWT Tools
Copied from the id-proto-debugger release 0.9.5 user guide, which is the debugger this service embeds. Its addresses are the embedded ones: the debugger is
https://localhost:8444/and its apihttps://localhost:8444/api. Accessing the debugger says how to reach, enable and disable it.
JWT Tools (/jwt_tools.html) builds, signs, encrypts, verifies, and
decrypts a JSON Web Token in the browser. Open it from the Tools pane
on oauth2_oidc_1.html or oauth2_oidc_2.html. ← Return to debugger
goes back to the page you came from.
Signing and verification go through jws.js’s pure-JavaScript backend
(crypto_provider.js, #463), and encryption through jose_jwe.js, which is
pure JavaScript too, so the page works on every origin, plain HTTP included.
Its algorithm menu has no Ed448, no secp256k1 and no post-quantum alg.
Those are on the Digital Signature JWS pane.
Nothing on this page is written to localStorage. Keys live for the
session.
This page has no screenshot. The pictures in the OAuth2 / OIDC guide come from the Selenium jobs, and those jobs were not re-run for this pass.
Overview
JWT Tools (/jwt_tools.html) builds, signs, encrypts, verifies, and
decrypts a token in the browser. Open it from the Tools pane on the
OAuth2 / OIDC pages. Everything runs in pure JavaScript, on any origin.
The signing menu is RS256 (the default) and the rest of RS* / PS*,
ES256 / ES384 / ES512, EdDSA (Ed25519), and HS256 / HS384 /
HS512. Ed448, secp256k1, and the post-quantum algorithms are on the
Digital Signature page’s JWS pane.
Encryption pairs a key-management algorithm with a content-encryption
algorithm. Key Management defaults to RSA-OAEP (also RSA-OAEP-256
and ECDH-ES, ECDH-ES+A128KW, +A192KW, +A256KW, all on P-256).
Content Encryption defaults to A256GCM (also A192GCM, A128GCM,
A128CBC-HS256, A192CBC-HS384, A256CBC-HS512). RSA1_5 is not
offered. AES-192 (A192GCM, A192CBC-HS384, and ECDH-ES+A192KW) fails
in Chromium-based browsers. Nothing on this page is written to
localStorage.
The fields, the defaults, and the trust-chain checkbox are in JWT Tools.
1. Compose
| Field or button | What it does |
|---|---|
| JWT Header | JOSE header as JSON. The page starts it with a sample alg, typ, and kid. |
| JWT Payload | Claims as JSON. The sample carries the RFC 7519 registered claims with placeholder values. |
| Encoded JWT | Compact form. Editing the header or payload rebuilds BASE64URL(header).BASE64URL(payload). with a trailing dot and no signature. Pasting a token decodes it back into the two boxes. A pasted signature is also copied into JWT to Verify and Signed JWT. |
| Add Custom Claim | Name, value, value type (String, Number, Boolean, JSON), and target (Payload or Header). Add inserts it. |
| Generate RFC 9068 Token | Replaces the three boxes with an unsigned sample access token, typ at+jwt. Sign it in pane 2. |
| JWT RFC Compliance | Checks the token against RFC 7519 and RFC 7515. The report is Compliance Output. |
| RFC 9068 Compliance | The same, as an OAuth 2.0 JWT access token. typ of at+jwt or application/at+jwt passes in any case. Five checkboxes under the button ship clear: verify the signature with pane 4’s key (unchecked, the report says SKIP signature rather than leaving the step out), decrypt a JWE with pane 5’s key before the claim checks, compare iss / aud / client_id with the workflow, check groups / roles / entitlements, and compare auth_time / acr / amr with the workflow’s original access token. Decrypting leaves the compose boxes as they are and checks the inner JWT. iss and aud are compared only by the workflow checkbox; without it they report SKIP … not compared. The report ends with a summary line that names any of the signature, iss and aud it did not check, and says “All checks passed.” only when it checked all three. exp fails once it is in the past. |
A status line under the boxes reports the sync, or a JSON parse error.
2. Sign (JWS)
Pick the algorithm, then Generate Keys, then Generate Signed JWT. The menu is read when you click. A key generated for one family will not sign another.
| Algorithm | Key Generate Keys produces |
|---|---|
RS256 RS384 RS512 (default RS256) |
RSA, RSASSA-PKCS1-v1_5. Size from RSA Key Size. |
PS256 PS384 PS512 |
RSA, RSASSA-PSS. Same size list. |
ES256 ES384 ES512 |
P-256, P-384, P-521. |
EdDSA |
Ed25519. |
HS256 HS384 HS512 |
A random shared secret. No public key. |
RSA Key Size is 2048, 3072, 4096, or 1024 (labelled insecure). It
applies to RS* and PS* only.
Private Key (PKCS#8) / HMAC Secret and Public Key (SPKI) show PEM. Show keys as JWK rewrites both boxes as JWK. You can paste your own PEM or JWK.
Keystore format is PEM, JWK, DER, or PKCS#12. Password encrypts the private key (required for PKCS#12). Download Keys saves the file. DER is two files. PKCS#12 export is not offered for EdDSA; use PEM, DER, or JWK.
Generate Signed JWT signs the header and payload, sets alg to the
menu, and copies the result into Signed JWT, Encoded JWT, JWT to
Verify, and pane 3’s Payload to Encrypt.
Validate a signature
Verification uses the alg inside the token, not the menu above.
| Field | Default | What it does |
|---|---|---|
| JWT to Verify | the token just signed | Any compact JWS. |
| Verification Type | HMAC Secret | Also X.509 Certificate (PEM), JWKS (JSON), and JWKS (URL). |
| Verification Key / URL | filled from the key you generated, and from x5c when the header has one |
Secret, PEM, JWKS JSON, or a URL. A certificate and a bare public key both work. A bundle uses the first certificate as the signer. |
| Validate the full certificate trust chain | off | Opens CA Trust Chain (PEM). The signer and this chain are checked together, including key usage (digitalSignature on the signer, keyCertSign on the issuers). x5c fills the signer into the key box and the rest into the chain. |
| Verify | Writes the result to Verification Output. |
JWKS (JSON) and JWKS (URL) select the key by kid and verify every
algorithm this page can sign, not only RSA. View certificate details
opens the certificate page when the key box holds a certificate.
3. Encrypt (JWE)
| Field | Default | What it does |
|---|---|---|
Key Management (alg) |
RSA-OAEP | Also RSA-OAEP-256, ECDH-ES (P-256), and ECDH-ES+A128KW, +A192KW, +A256KW, all on P-256. And the draft post-quantum and HPKE algorithms: ML-KEM-512/768/1024 and their +A*KW forms, HPKE-0 … HPKE-16 and their -KE forms (HPKE-10/11 are X-Wing). See jwe-pq-kem.md. |
Content Encryption (enc) |
A256GCM | Also A192GCM, A128GCM, A128CBC-HS256, A192CBC-HS384, and A256CBC-HS512. |
| RSA Key Size | 2048 | Also 3072, 4096, 1024 (insecure). Ignored for ECDH-ES. |
| Generate Keys | Recipient pair: RSA for RSA-OAEP*, P-256 for ECDH-ES*. For ML-KEM and HPKE, a JWK pair (kty: AKP, or EC/OKP for HPKE-0 … 7) whose alg is the selected one, and the JWK box is ticked: these keys have no PEM form. Their Download Keys is JWK only. |
|
| Show keys as JWK | off | PEM or JWK, same as pane 2. |
| Keystore format / Password / Download Keys | PEM | Same export rules as pane 2. |
| Payload to Encrypt | the signed JWT from pane 2 | Any text. A payload that is itself a JWS is marked cty: JWT. |
| Encrypt JWT | A five-part compact JWE, using the recipient public key. Copied into Encrypted JWT (JWE), JWE to Decrypt, and pane 1’s encoded box. | |
| JWE to Decrypt | the JWE just produced | Decryption uses the recipient private key and the alg / enc in the protected header. |
| Decrypt JWT | Plaintext, or the inner JWS, in Decryption Output. |
AES-192 (A192GCM, A192CBC-HS384, and ECDH-ES+A192KW) works in every
browser: jose_jwe.js does all of AES in pure JavaScript (#463), so
Chromium’s missing 192-bit AES no longer matters.
RSA1_5 is not in the menu. jose_jwe.js does not implement it.
A bare HPKE-n is HPKE Integrated Encryption. Its JWE has no enc, so the
Content Encryption menu is not used, and the IV and tag segments are
empty.