Skip to main content
CodeLint.Dev AI · Dev · Finance

HTTP Message Signature Debugger

Paste a signed HTTP request or webhook and its key to see whether the signature verifies — and, when it does not, exactly why. RFC 9421 with Content-Digest, and the ACP webhook HMAC.

Load a sample

Keys, secrets and messages are verified in your browser and are never sent anywhere. A UCP-style order webhook signed with ES256. It verifies.

The request or status line, the headers, a blank line, then the body exactly as it was sent.

A JWK, a JWK Set or a whole UCP profile (the key is picked by keyid), a PEM public key, or a shared secret.

Checking the signature…

How an RFC 9421 signature is built

An HTTP message signature does not cover "the request". It covers a list of components the signer chose, and two headers carry the result. Signature-Input names the components and the parameters; Signature carries the signature bytes. Both are structured-field dictionaries keyed by a label, so one message can carry several signatures.

The signer and the verifier each do the same four things:

  1. Take the covered components in order. Each is a lowercased header name, such as "content-type", or a derived component starting with @, such as "@method".
  2. Write one line per component: the identifier in double quotes, a colon, a space, the value. Repeated headers are joined with a comma and a space; surrounding whitespace is dropped.
  3. Add a last line, "@signature-params", whose value is the covered list and the parameters exactly as they appear in Signature-Input, without the label.
  4. Join the lines with a single LF, with no newline after the last one. That text is the signature base. The signer signs it; the verifier rebuilds it from the message it received and checks the signature against it.

The body is not a component. To protect it, the sender adds a Content-Digest header holding a hash of the body and covers that header. A verifier therefore has two checks to make: the signature against the signature base, and the digest against the body. A signature can pass while the body has been replaced, if the second check is skipped.

Sources, read on 22 November 2026: RFC 9421, HTTP Message Signatures (sections 2 to 4); RFC 9530, Digest Fields; RFC 8941, Structured Field Values for HTTP.

A worked example

The first sample on this page: an order webhook signed with ES256, using the P-256 test key published in RFC 9421 Appendix B.1.3. The signature base below is what the tool computes for it. The remaining samples show the two checks in code, and the fixes for the commonest signer mistake.

The signed message
POST /webhooks/ucp/orders HTTP/1.1
Host: platform.example.com
Content-Type: application/json
UCP-Agent: profile="https://merchant.example/.well-known/ucp"
Webhook-Id: evt_01JD3X8Q2M
Webhook-Timestamp: 1794821400
Content-Digest: sha-256=:zkorWxMCJ31MC7+CjIMxtzAHI2NveQwI0y8Gv/PZfgE=:
Signature-Input: sig1=("@method" "@authority" "@path" "ucp-agent" "content-digest" "content-type");created=1794821400;keyid="test-key-ecc-p256"
Signature: sig1=:lt+DfZ4g9Oo9n40XiorNUS8D9D9tsXUWgbCiYmIalogZVesO12jEOKnWR4vXXZKujp4Xh8QFrDts3VFnLzwIzg==:

{"id":"order_8f3a2c","event_id":"evt_01JD3X8Q2M","status":"shipped","fulfillments":[{"id":"ful_1","carrier":"USPS","tracking_number":"9400111899223456789012"}]}
Its signature base — six component lines and @signature-params, joined by LF, no final newline
"@method": POST
"@authority": platform.example.com
"@path": /webhooks/ucp/orders
"ucp-agent": profile="https://merchant.example/.well-known/ucp"
"content-digest": sha-256=:zkorWxMCJ31MC7+CjIMxtzAHI2NveQwI0y8Gv/PZfgE=:
"content-type": application/json
"@signature-params": ("@method" "@authority" "@path" "ucp-agent" "content-digest" "content-type");created=1794821400;keyid="test-key-ecc-p256"
Verifying it with WebCrypto
// jwk is the public key whose kid equals the signature's keyid.
const key = await crypto.subtle.importKey(
  'jwk', jwk, { name: 'ECDSA', namedCurve: 'P-256' }, false, ['verify']);

// 1. The signature: 64 raw bytes (r || s), against the signature base.
const signatureOk = await crypto.subtle.verify(
  { name: 'ECDSA', hash: 'SHA-256' }, key,
  signatureBytes,                               // base64-decoded from Signature
  new TextEncoder().encode(signatureBase));     // rebuilt from the received message

// 2. The body: its SHA-256, against the covered Content-Digest header.
const hash = new Uint8Array(await crypto.subtle.digest('SHA-256', rawBodyBytes));
const digestOk =
  contentDigestHeader === 'sha-256=:' + btoa(String.fromCharCode(...hash)) + ':';

const accepted = signatureOk && digestOk;
Signing in Node.js: raw r||s instead of DER
import { sign } from 'node:crypto';

// dsaEncoding defaults to 'der'. RFC 9421 needs the fixed-width form.
const signature = sign('sha256', Buffer.from(signatureBase),
  { key: privateKey, dsaEncoding: 'ieee-p1363' });   // 64 bytes for P-256
Signing in Python (cryptography): converting DER to raw r||s
from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature

r, s = decode_dss_signature(der_signature)
signature = r.to_bytes(32, 'big') + s.to_bytes(32, 'big')   # 48 bytes each for P-384
Verifying an ACP Merchant-Signature in Node.js
import { createHmac, timingSafeEqual } from 'node:crypto';

// rawBody is the request body exactly as received, before any JSON parsing.
function verifyAcpWebhook(rawBody, header, secret, tolerance = 300) {
  const m = /^t=(\d+),v1=([a-fA-F0-9]{64})$/.exec(header ?? '');
  if (!m) return false;                                        // missing or malformed
  if (Math.abs(Date.now() / 1000 - Number(m[1])) > tolerance) return false;
  const expected = createHmac('sha256', secret)
    .update(m[1] + '.').update(rawBody).digest();
  return timingSafeEqual(expected, Buffer.from(m[2], 'hex'));  // constant time
}

Derived components

Components that begin with @ are computed from the message rather than copied from a header. The examples are for POST /path?param=value sent to www.example.com over HTTPS, as in RFC 9421 section 2.2.

ComponentFound inValueExample
@methodRequestThe method, case unchangedPOST
@target-uriRequestThe full target URI: scheme, authority, path and queryhttps://www.example.com/path?param=value
@authorityRequestHost and optional port — from Host in HTTP/1.1 — lowercased, default port omittedwww.example.com
@schemeRequestThe scheme, lowercasedhttps
@request-targetRequestThe target as written on the request line. Not recommended outside HTTP/1.1/path?param=value
@pathRequestThe path without the query. An empty path is /. Percent-encoding is left as it is/path
@queryRequestThe query including its leading ?. With no query, the value is ? alone?param=value
@query-paramRequestOne query parameter, chosen with ;name="…": decoded, then percent-encoded again. A parameter that occurs twice cannot be covered this way"@query-param";name="param" → value
@statusResponseThe three-digit status code, without the reason phrase200

The scheme and, behind a proxy, the authority are not part of a pasted HTTP/1.1 message. The tool assumes https and reads Host; both can be set under Overrides.

Parameters on a covered header

A component identifier may carry flags that change how its value is produced (RFC 9421 section 2.1). They are part of the identifier, so "content-digest" and "content-digest";req are different components.

ParameterEffectIn this tool
;reqIn a response signature, take the component from the request that produced the responseSupported, for headers and derived components. Paste the request under Overrides → Related request
;key="member"Treat the header as a structured-field Dictionary and use one member, re-serialised strictlySupported
;bsWrap each header line as a base64 byte sequence before joining, so that commas inside values stay unambiguousSupported
;sfRe-serialise the header strictly as a structured field. The verifier must know whether the field is a List, a Dictionary or an ItemSupported for fields whose type is known: Content-Digest, Repr-Digest, Signature, Signature-Input, Signature-Agent, UCP-Agent, Priority, Cache-Status, Proxy-Status, Client-Cert and a few more. For any other field it is reported as unsupported rather than guessed
;trTake the value from the trailer sectionNot supported; a pasted message has no trailers

Algorithms, signature encoding and length

The six algorithms in the HTTP Signature Algorithms registry of RFC 9421 section 6.2. A signature of the wrong length for its algorithm cannot verify, and the length usually says what went wrong.

alg valueKeyHashSignature bytesLengthSame as JOSE
ecdsa-p256-sha256EC, curve P-256SHA-256r then s, each a big-endian integer zero-padded to 32 bytes. Not ASN.1 DER64 bytesES256
ecdsa-p384-sha384EC, curve P-384SHA-384r then s, each zero-padded to 48 bytes. Not ASN.1 DER96 bytesES384
ed25519Ed25519None; the base is signed directlyR then S, as in RFC 803264 bytesEdDSA
hmac-sha256Shared secretSHA-256The HMAC output32 bytesHS256
rsa-pss-sha512RSASHA-512, MGF1 with SHA-512, salt of 64 bytesThe RSASSA-PSS outputThe size of the modulus: 256 bytes for a 2048-bit keyPS512
rsa-v1_5-sha256RSASHA-256The RSASSA-PKCS1-v1_5 outputThe size of the modulus: 256 bytes for a 2048-bit keyRS256

The alg parameter is optional. Without it the algorithm comes from the key — a JWK "alg", or the key type and curve. If both state an algorithm they must agree, or verification fails (RFC 9421 section 3.2). An RSA key with no stated algorithm fits two of these, so the tool tries both and says which verified. In the header, the bytes are standard base64 between colons.

Why signatures fail, and how to fix each cause

These are the failures the tool reports by name. The first group stops verification before any cryptography happens; the rest explain a signature that was checked and did not verify.

No Signature or Signature-Input header

Cause: The message was not signed, or the headers were removed before it reached you — some gateways drop headers they do not know. A Signature header of the form keyId="…",headers="…",signature="…" with no Signature-Input is a different, earlier scheme from the "Signing HTTP Messages" drafts, not RFC 9421.

Fix: Check the request as it left the sender, then at each hop. RFC 9421 needs both headers on the message. For the earlier draft format, use a verifier written for that draft.

A label is in Signature-Input but not in Signature, or the reverse

Cause: Each signature is a pair: a member of Signature-Input and a member of Signature under the same label. The labels differ — sig1 in one and sig in the other — or one header was truncated or overwritten when a second signature was added.

Fix: Use the same label in both headers. When adding a signature to a message that already has one, append to both headers with a new label; do not replace either.

A covered component is missing from the message

Cause: Signature-Input lists a header the message does not have. It was removed in transit, or the signer listed a header it never sent. Without the value the signature base cannot be built at all, so this fails before the signature is looked at.

Fix: Cover only what you send and what survives the path to the receiver. Hop-by-hop headers and headers that proxies rewrite are poor choices. In a response signature, a request component needs the req flag.

Content-Digest does not match the body

Cause: The signature may be perfectly valid — it covers the Content-Digest header — while the body no longer hashes to that value. The body was changed after signing, or the digest was taken over one serialisation of the JSON and another was sent. Middleware that parses and re-writes the body is the usual culprit.

Fix: Compute the digest over the exact bytes you put on the wire, and send those bytes. On the receiving side, hash the raw body before any parser touches it. Intermediaries must not re-serialise a signed body.

created is in the future, or the signature has expired

Cause: created and expires are Unix times in seconds. A value in milliseconds lands tens of thousands of years ahead. Otherwise the clocks of signer and verifier disagree, or the message was held or replayed past its expires time.

Fix: Send whole seconds. Keep both clocks synchronised. When checking a captured message, set the verification time to when it was received — a signature that has expired since is not a signing bug.

The key type does not fit the algorithm

Cause: The alg parameter names one algorithm and the key is for another — alg="ed25519" with a P-256 key, for example — or the JWK carries an "alg" that contradicts the signature. Often the wrong key was looked up.

Fix: Make the two agree. Under UCP, leave alg out of Signature-Input and let the key decide. Check that keyid selects the key you meant.

The ECDSA signature is 70 to 72 bytes and begins with 0x30

Cause: It is ASN.1 DER-encoded, which is what OpenSSL, Java and .NET return by default. RFC 9421 requires the raw form: r and s at fixed width, 64 bytes for P-256.

Fix: Ask the library for the IEEE P1363 (raw) format, or decode the DER and concatenate r and s, each left-padded with zeros to 32 bytes (48 for P-384), before base64-encoding.

The signature or digest uses "-" and "_" instead of "+" and "/"

Cause: It was encoded as base64url, as JWTs are. Signature and Content-Digest are structured-field byte sequences, which use standard base64 with padding, between colons. A strict parser rejects the whole header, so the signature is treated as absent.

Fix: Use standard base64. In JavaScript, btoa() output is right; a JWT or base64url helper is not.

The signature is the wrong length

Cause: Apart from DER, the value may be hexadecimal instead of base64, base64-encoded twice, truncated, or made with a different algorithm or key size than the one named.

Fix: Compare the decoded length with the algorithm table above, then check how the bytes are turned into text.

keyid is not in the key set

Cause: The signer used a key the verifier cannot find: a newly rotated key that is not published yet, an old one already removed, the profile of another environment, or a keyid that does not equal the kid of the key.

Fix: Publish the new key before signing with it and keep the old one published while signatures made with it are still in flight. Make keyid exactly the kid of the signing key.

Everything looks right and the signature still does not verify

Cause: The two sides built different signature bases. In rough order of likelihood: a different key; a covered header whose value changed on the way (Content-Type gaining a charset, Host rewritten by a proxy); an @authority, @path or @query that was normalised differently; an @signature-params line that does not match Signature-Input character for character; a base with a trailing newline or CRLF line endings.

Fix: Log the signature base on the signing side and compare it with the one shown here. The first differing character is the cause. The tool tries the common variants itself and says so when one of them verifies.

ACP: the timestamp is outside the allowed window

Cause: The t value in Merchant-Signature is more than the tolerance — 300 seconds is recommended — from the receiver's clock. The webhook was delayed or replayed, a clock is wrong, or t is in milliseconds.

Fix: Send t in whole seconds at the moment of sending, and sign again on each retry. When testing a captured webhook here, set the verification time to when it arrived.

ACP: the HMAC does not match

Cause: The receiver hashed different bytes from the sender, or used a different secret. Parsing the JSON and re-serialising it before verifying changes the bytes. Test and live secrets differ, and a secret read from a file may carry a trailing newline.

Fix: Verify against the raw request body, before any JSON parser. Compute HMAC-SHA256 over the timestamp, a dot, then the body, and compare with v1 in constant time.

What UCP requires on top of RFC 9421

RFC 9421 lets the signer choose what to cover. The Universal Commerce Protocol does not: a UCP verifier skips a signature that leaves out any of these, treating what is not covered as unsigned. This is the rule in version 2026-08-25 of the specification.

ComponentMust be covered whenWhy
@method, @authority, @pathAlways, on a requestBinds the signature to one method, host and path, so it cannot be replayed against another endpoint
@queryThe request has a query stringThe query is part of the target
content-digest, content-typeThe message has a bodyThe only way the body is protected. Content-Digest must use sha-256, over the raw bytes
idempotency-keyThe Idempotency-Key header is presentUCP relies on the signed idempotency key, not on signature timestamps, to stop replays
ucp-agentThe UCP-Agent header is presentBinds the signer's profile URL, which is where the key comes from
signature-agentThe Signature-Agent header is presentOnly for the optional Web Bot Auth shape, covered as "signature-agent";key="<label>"
@statusAlways, on a responseA response has no method or path; with a body it also covers content-digest and content-type

An order webhook is a request from the business to the platform, must be signed, and must carry UCP-Agent — so under the rule above it covers ucp-agent as well. The webhook example on the 2026-08-25 order page lists only @method, @authority, @path, content-digest and content-type; the tool follows the verification algorithm and reports ucp-agent as missing in that case.

Other UCP signing rules

The tool checks these in a separate group, shown when the message carries a UCP-Agent header, when the key is a UCP profile, or when you ask for it under Overrides.

  • Algorithm —Every implementation must be able to verify ES256 (ECDSA P-256). ES384 and EdDSA (Ed25519) are optional, so a counterparty may answer algorithm_unsupported. The algorithm is taken from the key's kty and crv; alg is not included in Signature-Input.
  • Keys —Public keys are JWKs in the top-level keys array — a JWK Set — of the signer's profile at /.well-known/ucp. The verifier matches the signature's keyid to a key's kid, skipping keys marked "use": "enc" or whose key_ops lacks verify. The profile URL comes from the UCP-Agent header: UCP-Agent: profile="https://…", which must be HTTPS.
  • Encoding —ECDSA signatures must be raw r||s — 64 bytes for P-256, 96 for P-384 — not DER. The specification notes that many libraries default to DER and need an explicit conversion.
  • Timestamps —created is optional for an ordinary UCP signature; replay protection is the signed Idempotency-Key. A signature tagged tag="web-bot-auth" must carry both created and expires, use the key's RFC 7638 thumbprint as keyid, and should carry a nonce.
  • Several signatures —A message may carry more than one. A UCP verifier tries each and accepts the message when at least one verifies. UCP defines no tag of its own, and signatures with a tag other than web-bot-auth are skipped.
  • Error codes —A failed check is reported with signature_missing (401), signature_invalid (401), key_not_found (401), digest_mismatch (400) or algorithm_unsupported (400). The tool says which one a UCP verifier would return.
  • Sources —Read on 22 November 2026, version 2026-08-25: Message Signatures, the Identity Resolution Algorithm in the specification overview, and webhook signing on the Order capability page. To check a store's profile and published keys, use the UCP store tester.

The ACP order-webhook signature

The Agentic Commerce Protocol signs order webhooks with a shared secret rather than a key pair. The merchant sends one header:

Merchant-Signature: t=<unix_seconds>,v1=<64 hex characters>

  • t is the time of sending, in whole Unix seconds.
  • v1 is HMAC-SHA256, keyed with the shared secret, over the timestamp, a dot, and the raw request body — timestamp + "." + raw_body — written as 64 hexadecimal characters. Upper and lower case are both accepted.
  • The receiver answers 401 if the header is missing or malformed, if the timestamp is outside its window, or if the HMAC does not match. The recommended tolerance is 300 seconds.

Only the body and the timestamp are protected; the path, the host and the other headers are not. The whole scheme depends on both sides hashing the same bytes, so verify against the body exactly as received, before it is parsed. The specification does not say how the secret is turned into key bytes; the tool uses it as text first and also tries base64 and hexadecimal, telling you which one matched.

A minimal verifier in Node.js is among the code samples above.

Source, read on 22 November 2026: the webhook description in the ACP repository, spec/2026-04-17/openapi/openapi.agentic_checkout_webhook.yaml, and the 2026-04-17 changelog entry that introduced the format.

About

The HTTP Message Signature Debugger checks the signature on an HTTP request, response or webhook and, when it does not verify, says why. Paste the message as it was sent — the request or status line, the headers, a blank line, the body — and the key, and it rebuilds what the signer must have signed and compares. It covers two schemes. The first is RFC 9421 HTTP Message Signatures with an RFC 9530 Content-Digest, the scheme the Universal Commerce Protocol uses for agent requests and order webhooks: the tool parses Signature-Input and Signature, builds the signature base line by line and shows it, verifies with ECDSA P-256 or P-384, Ed25519, RSA-PSS, RSA PKCS #1 v1.5 or HMAC-SHA256, recomputes the body digest, and checks the created and expires times. The second is the Agentic Commerce Protocol order webhook, a Merchant-Signature header holding a timestamp and an HMAC-SHA256 of the timestamp and body. A signature either verifies or it does not, and a library that only answers "invalid" leaves you guessing; this page names the cause where it can — a covered header that is missing, a body changed after signing, a keyid that is not in the key set, an ECDSA signature in DER encoding instead of raw r||s, base64url where base64 is required, an expired signature — and otherwise lists the usual suspects in order. It can also sign a message with a test key, to give you a reference signature to hold against your own. Everything runs in your browser with WebCrypto; keys, secrets and messages are never sent anywhere.

How to use

  1. 1 Paste the signed message into "HTTP message": the request line (or status line), every header, a blank line, then the body exactly as sent. The page opens on a passing sample so you can see a full report first.
  2. 2 Paste the key into "Verification key": a JWK, a JWK Set or a whole UCP profile (the key is chosen by the signature's keyid), a PEM public key, or the shared secret for an HMAC or ACP signature.
  3. 3 Leave "Scheme" on automatic. It picks RFC 9421 when the message has Signature-Input, and the ACP webhook check when it has Merchant-Signature.
  4. 4 Read the verdict and "Checks" for each signature. If it fails, compare "Signature base" with the base your own code builds — the first line that differs is the bug.
  5. 5 If the request went through a proxy, or you captured it earlier, open "Overrides" to set the host and scheme the signer saw and the time the message was received.
  6. 6 To get a known-good signature for the same message, open "Signing helper", generate a test key and sign. Then compare its headers and signature base with yours.
Is the key or the message I paste sent to a server?
No. Parsing, hashing and signature verification all run in JavaScript in your browser, using the browser's built-in WebCrypto, and the page makes no request with what you type. That matters here more than for most tools: a captured request carries credentials and customer data, and the key box may hold a webhook secret. For verification you only ever need the public key. If you paste a private key the tool uses its public half, warns you, and still sends nothing.
What is a signature base, and why does the tool show it?
It is the exact text that gets signed. RFC 9421 does not sign the raw request; it signs a small document built from it: one line per covered component, such as "@method": POST or "content-type": application/json, and a final "@signature-params" line that repeats the covered list and the parameters. Signer and verifier each build this text independently, and the signature verifies only if the two are identical byte for byte. So nearly every failure is a difference between two signature bases. Printing yours beside the one shown here, and finding the first line that differs, is the fastest way to locate the bug.
The signature verifies in my own tests but the receiver rejects it. Why?
Because the receiver did not see the message you signed. Something between you and it changed a covered component: a proxy rewrote Host, so @authority differs; a gateway stripped a path prefix; a framework added "; charset=utf-8" to Content-Type; an HTTP client re-serialised the JSON body after the digest was computed. Capture the request as the receiver got it, paste it here, and compare the signature base with yours. If only the host differs, set the original one under Overrides to confirm.
Why does my ECDSA signature fail when the key is right?
The most common reason is encoding. RFC 9421 requires an ECDSA signature as r and s concatenated at fixed width — 64 bytes for P-256, 96 for P-384. OpenSSL, Java and .NET return an ASN.1 DER structure by default, which is usually 70 to 72 bytes for P-256 and begins with the byte 0x30. The tool detects that, converts it and tells you if the converted signature verifies. The fix is in the signer: ask the library for the raw (IEEE P1363) format, or convert before base64-encoding.
Content-Digest is reported as a mismatch, but I copied the body exactly. What happened?
Possibly nothing. A digest is computed over bytes, and pasting text into a web page changes some of them: CRLF line endings become LF, and a final newline is easily lost or gained. When the digest does not match, the tool retries with CRLF line endings and with and without a final newline, and says so if one of those matches. If none does, the body really differs from what was hashed — most often because a JSON document was parsed and written out again somewhere between hashing and sending.
Which key formats does it accept?
A single JWK; a JWK Set, or a complete UCP profile whose keys array is one, from which the key is selected by the signature's keyid; a PEM public key ("BEGIN PUBLIC KEY", and the older "BEGIN RSA PUBLIC KEY"); or a shared secret, as text, base64 or hexadecimal, for HMAC and for the ACP webhook. A PKCS #8 private key is accepted and reduced to its public half. Certificates and the legacy "EC PRIVATE KEY" form are not read; the tool gives the openssl command that extracts the public key.
How is the ACP webhook signature different from RFC 9421?
It is much simpler and it is symmetric. ACP puts one header on the webhook, Merchant-Signature: t=<unix seconds>,v1=<64 hex characters>, where v1 is HMAC-SHA256, keyed with a secret both sides hold, over the timestamp, a dot and the raw body. Nothing but the body and timestamp is covered, there are no key identifiers, and the receiver rejects a timestamp more than a tolerance away from its own clock — 300 seconds is recommended. RFC 9421 signs chosen parts of the message with a choice of algorithms, usually asymmetric, so the verifier needs only a public key.

Also callable by your AI agent

This tool is available over the free CodeLint MCP server and REST API as http_signature_verify — no API key. Unlike this page, an API call is processed on our server.

curl -s https://codelint.dev/api/v1/tools/http_signature_verify \
  -H 'content-type: application/json' \
  -d '{"message":"POST /agentic_checkout/webhooks/order_events HTTP/1.1\nHost: agent.example.com\nContent-Type: application/json\nMerchant-Signature: t=1794821400,v1=a0976932a3bc2731fcc3db989509a8850ecf8712a183fd1d0e4f9d2a3a7dd5e8\n\n{\"type\":\"order_update\",\"data\":{\"id\":\"ord_123\"}}","key":"whsec_test_secret","now":1794821442}'

More in AI Tools

See all ai tools.