Skip to content
signer.tools

explainer

PAdES explained: how a digital signature actually lives inside a PDF

A practical tour of PDF digital signatures: byte ranges, CMS containers, PAdES baseline levels B-B to B-LTA, timestamps, and what trust lists change.

By 6 min read
Layout of a signed PDF file: two byte ranges are hashed together, skipping the hole that holds the CMS signature container.

When a PDF reader says "Signed and all signatures are valid", it has done something quite specific: it has found a signature container inside the file, recomputed a hash over almost every byte of the document, and checked that hash against a signature made with a certificate. PAdES is the European standard that pins down exactly how that should be done.

This article walks through what is physically inside a signed PDF, what the PAdES levels add, and why the same file can show a green tick in one reader and a warning in another.

The anatomy of a signed PDF

A PDF is a sequence of numbered objects: pages, fonts, images and so on, followed by a cross-reference table that tells a reader where each object starts. Signing adds a few objects of its own:

  • A signature field, which may or may not have a visible appearance on a page.
  • A signature dictionary, which holds metadata such as the signing time and reason, and two entries that matter most:
    • /Contents, a hexadecimal string reserved for the signature container. The signing software leaves room for it, typically several kilobytes of zeros, before computing anything.
    • /ByteRange, four numbers such as [0 84210 100596 2213]. They mean: hash 84,210 bytes starting at offset 0, then 2,213 bytes starting at offset 100,596. The gap in the middle is exactly the /Contents value.

The signer hashes those two ranges together, builds the signature container, and writes it into the gap. Because the container sits in the one part of the file that is not hashed, writing it does not change the hash.

A verifier does the reverse: it reads /ByteRange, hashes the same bytes, and compares the result with the digest stored inside the signature. One changed byte anywhere in the covered ranges, whether in a clause, a date or an invisible metadata field, makes the hashes differ.

What is inside the container

The /Contents value is a CMS SignedData structure, defined in RFC 5652. For a PAdES signature it contains:

  • Signed attributes, a small set of data that is itself signed:
    • the content type,
    • the message digest, which is the hash of the byte ranges,
    • a signing-certificate-v2 attribute, holding a hash of the signer's certificate so that the certificate cannot be swapped for another with the same key.
  • The signature value: the signed attributes, hashed and signed with the private key, for example RSA with SHA-256.
  • The certificate, and optionally the chain of certificates up to a root.
  • Optionally, unsigned attributes such as an RFC 3161 timestamp token over the signature value.

PAdES signatures declare the sub-filter ETSI.CAdES.detached. Older PDF signatures often use adbe.pkcs7.detached, which looks similar but is not held to the same rules. One notable difference is that PAdES does not rely on the signing time the signer claims in the dictionary; the trustworthy time comes from a timestamp.

The four PAdES baseline levels

ETSI EN 319 142-1 defines baseline profiles that build on each other:

Level Adds What it is for
B-B (basic) The CMS signature with the required signed attributes Integrity and the signer's certificate at signing time
B-T (timestamp) An RFC 3161 timestamp from a timestamp authority Proof that the signature existed at a given time, from a third party
B-LT (long term) Validation data in the PDF's Document Security Store: certificates, and revocation responses (OCSP or CRLs) The signature can be checked later even if the certificate authority's services disappear
B-LTA (long-term archival) A document timestamp over everything, renewed before the algorithms weaken Keeping the evidence valid for decades

A timestamp matters more than it may seem. Certificates expire, typically after one to three years. Without a trusted time, a verifier cannot tell whether a signature was made while the certificate was valid or afterwards. With a timestamp from an authority the verifier trusts, it can.

Incremental updates: how a signed PDF can still change

PDF allows incremental updates: new objects and a new cross-reference table can be appended to the end of a file without touching the earlier bytes. This is how a second person can sign a PDF that already carries a signature, and how form fields can be filled after signing.

It also means that "the signature is valid" and "the document you are looking at is what was signed" are separate questions. A good verifier reports both: whether the signed revision is intact, and whether anything was appended afterwards and what kind of change it was. Researchers at Ruhr University Bochum have published several attacks over the years, including "shadow attacks", that abused the gap between those two questions in some PDF readers. Most major readers have since been patched, which is one more reason to keep your PDF software up to date.

When signer.tools seals a document, the seal is the final revision: the byte ranges cover the whole file apart from the signature value. Anything added later shows up as a modification.

Trust: why the same file shows different results

Checking integrity is pure mathematics and gives the same answer everywhere. Checking identity depends on whether the verifier trusts the certificate chain, and that is configuration:

  • Adobe Acrobat and Reader trust certificates that chain to the Adobe Approved Trust List (AATL) and, optionally, the EU Trusted Lists (EUTL).
  • Operating systems and browsers have their own root stores, which are mostly used for websites, not documents.
  • The EU's validation tools check against the EU Trusted Lists.

So a PDF signed with a self-signed certificate, or one from a private certificate authority, will typically show "signature validity is unknown" or "the signer's identity has not been verified". That message is about identity. If the same reader also says the document has not been modified, the integrity check passed.

signer.tools seals documents with its own certificate by default, so Acrobat confirms the document is unchanged but labels the signer unverified. Anyone can still check the seal on our verify page, which compares it against the published seal certificate and our record of sealed fingerprints. A deployment can use a certificate from an AATL or EU-trusted authority instead, in which case Acrobat shows the signer as trusted.

What this means for you

  • To check a signed PDF, look at both the integrity result and the identity result. Our guide on how to verify a signed PDF explains how to read each reader's messages.
  • A visible signature image on a page is not the digital signature. The digital signature is the invisible container described above; the image is just an appearance, and some valid digital signatures have none.
  • A digital seal from a signing platform proves integrity from the moment of sealing. Evidence of who signed comes from the platform's audit trail. The difference between a platform seal and a signer's own certificate is covered in electronic vs digital signatures.

For the exact parameters signer.tools uses, see the security page.

Written by

Abdessamad designs and builds signer.tools, including its in-browser encryption, PDF sealing and verification. These guides explain how electronic signatures work underneath, in plain language, with the same care for accuracy that goes into the product.

All guides

explainer

How a signing link can carry its own decryption key

End-to-end encrypted e-signatures, explained: why the part of a URL after the # never reaches the server, how one secret becomes a token and a key, and the trade-offs.

· 5 min read