Skip to content
UniKit

JWT signer

Signs JWTs per RFC 7515: HS256/HS384/HS512 run a local HMAC (the unit tests assert the RFC 7515 Appendix A.1 vector whose expected signature segment is dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk), while RS / RSA-PSS / ES use browser WebCrypto. Custom headers and payloads are allowed, with 1h/30m/7d expiry, an nbf delay and an optional iat; the clock comes from the control, not from the system time.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Input

Result

Pure local computation; nothing is uploaded.

Enter input to see the result

Token length: 0 · Signature length: 0 · Signed locally (1 = yes): 0

What this tool does

  • Generate a test token with exp for API debugging without a backend.
  • Check your HMAC implementation against the official RFC 7515 vector.
  • Sign RS/ES tokens with browser WebCrypto so the private key never leaves the machine.

Example

Input

{"sub":"1234567890","name":"John Doe"}

Output

unsupported-algorithm / Algorithm not implemented locally

A JWK-sized key (40+ characters, exactly the Base64URL alphabet) is read as raw bytes, a short passphrase as UTF-8 text; the utf8: / base64: prefixes force either mode.

Frequently asked questions

How is the HS signature computed?

The signing input is Base64URL(header) + "." + Base64URL(payload); HMAC-SHA256/384/512 runs over it and the digest is Base64URL encoded without padding. Appendix A.1 expects the signature segment dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk and the unit test asserts it directly.

Why do RS/ES/PS need the browser?

Asymmetric signing needs crypto.subtle.sign, and pure logic modules may not touch browser APIs, so the page performs it in an event callback. An unsupported browser raises an explicit error instead of a fake signature.

How should I write the key?

A JWK-sized value (40+ characters using only Base64URL characters) is read as raw bytes, a short passphrase as UTF-8 text. Use the utf8: or base64: prefix to remove ambiguity.

Does it read the system clock?

No. You provide the current time in seconds; 0 means only the claims already present in the payload are written, so the same input always yields the same token.

Keywords:jwt signRFC 7515JWSwebcrypto

Related tools