WebCrypto Utility

HTTP Message Signatures: Signer and Verifier

For information on HTTP Message Signatures see IETF RFC 9421.

version ??

HTTP Message

Private Key

Public Key

Shared Secret

Covered Components

Signature Base

Signature-Input

Signature

Notes

RFC 9421 does not sign the message body. That is how the specification is designed, not a limitation of this page. To protect the content, the message must carry a Content-Digest header, defined in RFC 9530, Digest Fields, and the signature must cover that header; the signature then protects the body indirectly, through the digest. The button sets that header from the body, keeping the header's algorithm (sha-256 or sha-512; sha-512 if there is no header yet). When you verify a signature that covers Content-Digest, the page also checks the digest against the body, and warns if it does not match. The digest is computed over the body text as entered, with trailing newlines removed, so it may differ from a digest over the exact bytes sent on the wire.

Information that you paste here, including messages and keys, whether secret, private or public, never leaves your browser. Nothing gets posted to a server. Still, you should take care. It's good hygiene to never send private information, production private keys, or private credentials to a site you do not own and manage.

How to use this page
  1. This tool implements RFC 9421, HTTP Message Signatures, which supersedes the earlier draft-cavage-http-signatures specification. It uses webcrypto; it will run only on modern, current browsers. Ed25519 needs a recent browser.
  2. Algorithms: rsa-pss-sha512, rsa-v1_5-sha256, ecdsa-p256-sha256, ecdsa-p384-sha384, ed25519, and hmac-sha256.
  3. Enter the HTTP message as text: a request line (POST /path HTTP/1.1 with a Host header, or POST https://host/path) or a status line (HTTP/1.1 200 OK), then the headers, then optionally a blank line and the body.
  4. To sign:
    1. enter the message, and choose the covered components.
    2. select an algorithm, and specify an appropriate key.
    3. set the signature parameters: label, keyid, tag, expires, created, alg, nonce.
    4. click Sign. The tool produces the Signature-Input and Signature headers.
  5. To verify:
    1. enter the message.
    2. paste the Signature-Input and Signature values.
    3. select the algorithm if the signature has no alg parameter, and specify the key.
    4. click Verify. The signature base shows what was checked.
  6. The signature base updates as you change the message, the covered components, or the parameters. After you sign, later changes grey out the Signature-Input and Signature outputs until you sign again.
  7. On initial page load, the browser will generate a new keypair and load the test request from RFC 9421 Appendix B. The page keeps your message, keys, and settings in your browser's localStorage. You can generate a new key by clicking the reload button next to the key.
  8. When specifying the shared secret for hmac-sha256, you need at least 32 bytes of key material. The PBKDF2 option will derive a key of the appropriate size. If you choose a different coding system, you need to ensure minimum key size yourself.
  9. This tool supports HTTP fields and the derived components @method, @target-uri, @authority, @scheme, @request-target, @path, @query, @query-param, and @status. It does not support the sf, key, bs, req, or tr component parameters.