Skip to content
ecdsa.com

DKIM-Signature header

The header field (RFC 6376 §3.5) that carries a DKIM signature as tag=value pairs, including v, a, c, d, s, h, bh, b and the optional i, l, t and x tags.
Also written asDKIM-SignatureDKIM selector_domainkeybh tag

Example: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com; s=s2026; t=1792483200; x=1793088000; h=from:to:subject:date:message-id; bh=…; b=…. bh is the base64 SHA-256 of the canonicalized body; with relaxed body canonicalization an empty body hashes to 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=. The signature covers the listed headers in order and then the DKIM-Signature header itself with b= emptied.

Tags worth checking: h= must include From (RFC 6376 requires it); listing a header more times than it appears (oversigning) prevents attackers from adding a second copy; l= limits the signed body length, which lets anyone append content and should not be used; t= and x= give signing and expiry times; i= is the agent or user identifier within d=.

The key record at s._domainkey.d is v=DKIM1; k=rsa; p=… (base64 of the public key, a SubjectPublicKeyInfo for RSA in practice, the raw 32-byte key for k=ed25519); an empty p= revokes the key. A 2,048-bit RSA key is 392 base64 characters, longer than one 255-byte TXT string, so it must be split into several strings in one record.

Standards and references

All terms