skip to content

CMS SignedData

How a signature is carried and checked: multipart/signed with a detached pkcs7-signature, the opaque alternative, and the signed attributes. Interviewers ask because it must survive relaying.

on this pageshow

explore

questions

5

What does an S/MIME signature on an email show the recipient that the sending domain's DKIM signature does not?

level: juniorimportance: must knowfreq 45%

answer

  1. whose key, whose name
  2. one person or a whole domain
  3. certificate binds a mailbox
  4. body signed, outer headers not

basics

~20 s

An S/MIME signature is made with the author's own private key and verified with a certificate naming the author's mailbox, so it ties the message body to that person. A DKIM signature ties the message only to the sending domain.

solid answer

~50 s

An S/MIME signature is a CMS `SignedData` structure that the author's mail client creates with the author's private key; the recipient's client verifies it with the author's certificate, which binds that key to a mailbox address. It tells the reader that the holder of that personal key signed this body and that the body has not changed since. A DKIM signature is added by a signing system on behalf of a domain (the `d=` tag) with a key published in that domain's DNS: it says the domain takes some responsibility for the message, not which employee wrote it, and any system allowed to use the domain key could have produced it. One limit runs the other way: by default the S/MIME signature covers the MIME body, not the `From` or `Subject` header fields, so the client must also check `From` against the certificate's address.

go deeper

for a junior

Recall the one-line contrast: S/MIME signs with the author's personal key and certificate, DKIM signs on behalf of the whole sending domain.

for a middle

Walk through what the client checks: the digest against messageDigest, the signature with the signer's certificate, the certificate chain, then the From address against the certificate.

for a senior

Name the gap a weaker answer misses: the S/MIME signature covers the body, not the outer header fields, and any system allowed to use the domain key can produce a DKIM pass.

for a principal

Frame the cost: personal certificates mean issuance, client setup and support, and they pay off only where an individual's word must be checkable later; DKIM alone serves domain reputation.

## Two signatures, two different signers Internet mail can carry two unrelated kinds of signature, and an interviewer asking this question wants to hear that they answer different questions. - An **S/MIME signature** is a CMS `SignedData` structure (Cryptographic Message Syntax, RFC 5652) that the author's own mail client creates with the **author's private key**. The matching public key sits in the author's certificate, which binds it to a mailbox address such as `[email protected]`. - A **DKIM signature** is a `DKIM-Signature` header field that a signing system adds **on behalf of a domain**, named in its `d=` tag, using a key the domain publishes in DNS. How that header field is built and verified is covered in the material on DKIM; here it serves only as the contrast. The difference is **who holds the key**. Only the author, or whoever has the author's key, can produce the S/MIME signature. Any system the domain operator lets use the domain key — the outbound mail server, a ticketing platform, a newsletter service — can produce a valid DKIM signature for mail from that domain. ## What each one tells the reader | Question the reader asks | S/MIME signature | DKIM signature | |---|---|---| | Who vouches for the message? | the holder of a personal key whose certificate names a mailbox | the signing domain | | Is the body unchanged? | yes, the signed body | yes, for the body the signer covered | | Is the `From` header field covered? | not by default | yes, `From` must be in the signed header list | | Who normally checks it? | the recipient's mail client, when the message is opened | usually the receiving mail system, on arrival | | Does it identify an individual? | yes, as far as the certificate's issuer verified the mailbox | no | RFC 8551 states that applying a `SignedData` signature to a message provides authentication, message integrity and non-repudiation of origin. What those properties mean in general, and when they really hold, belongs to the material on digital signatures; the point for mail is that the S/MIME signature attaches them to **a person's key**, not to a domain. ## What the reader's client actually checks When a signed message is opened, the client works through roughly these steps: 1. It finds the `SignedData` object — the detached signature part of a `multipart/signed` message, or the opaque `application/pkcs7-mime` body. 2. It recomputes the digest of the signed content and compares it with the `messageDigest` signed attribute. 3. It verifies the signature value with the public key from the signer's certificate, which the `SignedData` often carries. 4. It validates that certificate up to a trust anchor it accepts — the subject of the material on certificate chains. 5. It compares the address in `From` (or `Sender`) with a mail address in the certificate — a check covered with certificate discovery and trust. The last step exists because the S/MIME signature by default protects the **MIME body**, not the outer header fields. RFC 8551 lets a sender wrap the full message in `message/rfc822` so that `Subject`, `To` and `From` are signed too, but that is optional. ## Why "the domain already signs it" is not the same Organisations sometimes argue that DKIM makes personal signatures redundant. It does not, for three reasons: - **Granularity.** A DKIM pass says the message went through a system authorised to sign for `example.com`; it says nothing about whether Alice or a colleague at the next desk wrote it. - **Custody.** The domain key is held by mail infrastructure; the personal key is held by the author, on a device or a token. A signing system that is misused signs whatever it is handed. - **Purpose.** DKIM exists so receiving systems can decide how to treat a domain's mail. An S/MIME signature exists so the reader — and later an auditor reading the archive — can tell which person committed to the text. Neither signature says the content is true or that the sender is honest. Both say only that a particular key holder produced these bytes. ## What it means for the organisation If staff must be able to show that a particular person sent a statement — legal advice, an approval, a payment instruction — the organisation needs personal certificates and mail clients that sign, and DKIM cannot stand in for them. An organisation that only wants receivers to trust its domain does not need S/MIME for that. Many run both: DKIM for the domain's reputation and delivery, S/MIME for the people whose individual word must be checkable later.

  • If an organisation keeps staff S/MIME signing keys on a central gateway that signs outgoing mail, what does a signature from [email protected] still show?
    Only that the gateway, holding Alice's key, signed on her behalf. The signature still names her certificate, but it no longer shows that she personally committed to the text — it says little more than a domain signature would. Where individual accountability is the point, the signing key stays under the author's own control; how keys are held is covered in the material on private-key custody.
  • Can one message carry both an S/MIME signature and a DKIM signature, and does one disturb the other?
    Yes. The author's client applies the S/MIME signature as part of the body; the domain's signing system adds the `DKIM-Signature` header field later and covers that body as it receives it. The two are independent: a DKIM failure says nothing about the S/MIME signature, though a hop that rewrites the body can break both.

  • A DKIM pass already proves which employee wrote the message.
  • The outgoing mail server adds the S/MIME signature for the whole domain.
  • An S/MIME signature always protects the Subject and From header fields.
  • An S/MIME signature is verified with the recipient's own certificate.
  • A valid S/MIME signature proves that what the message says is true.
open as a page

In S/MIME, how does a detached multipart/signed message differ from an opaque application/pkcs7-mime signed-data message, and when is each chosen?

level: middleimportance: must knowfreq 34%

basics

~20 s

multipart/signed keeps the content readable and adds a detached SignedData part (smime.p7s); opaque application/pkcs7-mime with smime-type=signed-data wraps the content inside SignedData (smime.p7m). Detached is preferred for sending; opaque needs an S/MIME client but survives benign re-encoding.

open as a page

In CMS SignedData as S/MIME uses it, why is the signature computed over the signedAttrs, and what does the messageDigest attribute bind?

level: middleimportance: should knowfreq 18%

basics

~20 s

When signedAttrs is present, the signer puts the content's digest into a messageDigest attribute and signs the DER encoding of all signed attributes, so one signature covers the content, through its digest, and metadata such as content type and signing time.

open as a page

A regulator requires that a firm's S/MIME-signed client correspondence stays verifiable for years; which signed format, signature algorithms and archive rules do you standardise?

level: principalimportance: nice to knowfreq 9%

basics

~20 s

Standardise clear-signed multipart/signed with 7-bit encoding, S/MIME 4.0 algorithms (ECDSA P-256 or Ed25519, with RSA and SHA-256 kept while older correspondents need it), and archive each message byte-for-byte as received, with the certificates needed to re-check it.

open as a page