01What is HTTP Message Signature Builder?
RFC 9421 defines a way to sign parts of an HTTP request or response so the receiver can tell they were not changed. Getting it right is fiddly. The signer and verifier must build exactly the same text, called the signature base, byte for byte, and one stray space breaks everything. This tool builds that text from a message you paste, signs it, and writes the two headers the RFC defines. It can also check a message that already carries a signature. Paste a request or response with its start line and headers. In sign mode you list the covered components in order, such as "@method" "@path" "@authority" "content-type". Header names are lowercased. Repeated headers are joined with a comma and a space, and surrounding whitespace is trimmed, as Section 2.1 describes. Derived components follow Section 2.2. @authority lowercases the host and drops a default port. @query includes the leading question mark, or is a lone "?" when there is no query. @query-param takes a name parameter and fails if the parameter is missing or repeated. @status only works on responses, and the tool says so if you try it on a request. Each component becomes one line: the quoted name, a colon, a space and the value. The last line is "@signature-params", holding the component list and the parameters created, keyid and, if you tick the box, alg. There is no newline after it. The Signature-Input header repeats that same value under your label, and the Signature header carries the signature as base64 between colons. Signing uses Web Crypto with the algorithms in the RFC's registry: ed25519, ecdsa-p256-sha256, ecdsa-p384-sha384, rsa-pss-sha512 with a 64-byte salt, rsa-v1_5-sha256 and hmac-sha256. ECDSA signatures are the raw r and s values joined together, which is the form the RFC asks for. Keys can be PKCS#8 or SPKI PEM, a JWK, or for HMAC a base64 secret. The Ed25519 example uses the RFC's own test key and test request from Appendix B.2.6. Signing it produces wqcAqbmYJ2ji2glfAMaRy4gruYYnx2nE... exactly as printed in the RFC, which is a quick way to confirm the tool matches the standard. The HMAC example reproduces B.2.5 the same way. Load the tampered example and the verifier reports INVALID, because the signature still covers "@path": /foo while the request now says /bar. Limits: the sf, bs, key and req component parameters and the tag, nonce and expires parameters in the builder are not supported. The tool does not check created or expires against the clock. Ed25519 needs a browser with Ed25519 in Web Crypto. Keys stay in your browser.
API developers adding or debugging HTTP Message Signatures, and library authors testing against the RFC 9421 vectors. The tool runs entirely in your browser, so your data never leaves your device.
02How to use HTTP Message Signature Builder
- Choose Sign or Verify
- Paste the HTTP message, starting with the request line or status line
- Pick the algorithm and paste a key, or generate a test key
- In sign mode, list the covered components and set created, keyid and the label
- Press Sign or Verify and copy the signature base or the headers
03Worked examples
- Input:
Sign RFC 9421 test request with test-key-ed25519, components "date" "@method" "@path" "@authority" "content-type" "content-length", created=1618884473, label sig-b26 - Result:
Signature-Input: sig-b26=("date" "@method" "@path" "@authority" "content-type" "content-length");created=1618884473;keyid="test-key-ed25519" Signature: sig-b26=:wqcAqbmYJ2ji2glfAMaRy4gruYYnx2nEFN2HN6jrnDnQCK1u02Gb04v9EDgwUPiu4A0w6vuQv5lIp5WPpBKRCw==: - Matches RFC 9421 Appendix B.2.6.
- Input:
hmac-sha256 with test-shared-secret over "date" "@authority" "content-type", created=1618884473 - Result:
Signature: sig-b25=:pxcQw6G3AjtMBQjwo8XzkZf/bws5LelbaMk5rGIGtE8=: - Matches RFC 9421 Appendix B.2.5.
- Input:
Verify the B.2.6 request with the RFC Ed25519 public key after changing POST /foo? to POST /bar? - Result:
Untouched request: valid Tampered request: INVALID - The rebuilt base has "@path": /bar, so the signature no longer matches.
- Input:
HMAC sign HTTP/1.1 503 Service Unavailable (Content-Type: application/json, Content-Length: 14) over "@status" "content-type" "content-length", created=1618884476 - Result:
"@status": 503 "content-type": application/json "content-length": 14 "@signature-params": ("@status" "content-type" "content-length");created=1618884476;keyid="test-shared-secret" Signature: sig-resp=:aPf3w9eDtPd60p1d3yhyPTIp6Cvs+xISUm2+FyuYHOY=: - Input:
"@query-param";name="Pet" on POST /foo?param=Value&Pet=dog - Result:
"@query-param";name="Pet": dog - Input:
"@status" on the POST request, then "@query-param";name="missing" - Result:
@status can only be used on a response. Query parameter "missing" is not in the query string.
04Common use cases
- Checking that a server and client build the same RFC 9421 signature base
- Reproducing the RFC 9421 Appendix B test vectors while writing a library
- Signing a test request for an API that requires HTTP Message Signatures
- Verifying a captured request's Signature-Input and Signature headers against a public key
- Seeing how @authority, @query and @query-param values are derived from a raw request
- Signing a response's @status and headers to test a client that checks response signatures
- Confirming that a proxy rewriting the path or Host header really does break the signature
05Tips
- Compare the signature base line by line with your own code; one extra space breaks the signature
- ECDSA signatures change on every run, so verify them instead of comparing bytes
- Use the current-time button for created, and keep server clocks in sync
- Cover @authority and @method at least, so a signature cannot be replayed against another host or method
- If verification fails, copy the rebuilt signature base and diff it against the signer's log before blaming the key
06Related concepts
RFC 9421, signature base, Signature-Input header, structured fields, Ed25519, HMAC-SHA256.
Frequently Asked Questions
What is HTTP Message Signature Builder?
HTTP Message Signature Builder is a free, browser-based developer tool on AIDToolStack. Create the RFC 9421 signature base, Signature-Input and Signature headers, then sign or verify with Ed25519, ECDSA, RSA or HMAC in your browser. It requires no installation or sign-up and works entirely in your browser.
Is HTTP Message Signature Builder free to use?
Yes. No sign-up, no fees and no usage cap.
Does HTTP Message Signature Builder store my data?
No. It runs in your browser; nothing is uploaded.