Digital signature check · integrity and identity, not trust

Verify PDF Signature

Drop a signed PDF. The page finds every signature, hashes the exact bytes each one covers, checks the signature against the signer's certificate, reads the signer and signing time, and tells you whether anything was added to the file afterwards.

Signed PDF

Drop a signed PDF

Up to 100 MB. Encrypted files work: signatures are not encrypted.

This checks that the signed bytes are unchanged and that the signature was made by the key in the embedded certificate. It does not check whether you should trust that certificate: there is no list of trusted authorities here and no revocation lookup.

Verify PDF Digital Signatures

Operator: Abdulla Al Fahad. How tools are built and checked

A contract PDF shows a green tick in one reader and a warning in another, and the question that matters is whether a single byte changed after the signer pressed sign. Every signature dictionary in a PDF names a /ByteRange: the two stretches of the file the signature covers, with a gap between them that holds the signature itself. This page hashes exactly those bytes, compares the result with the digest sealed inside the signature, and verifies the signature value with the public key in the signer's certificate.

For each signature you get the signer and certificate details, the signing time and where it came from, the hash and signature algorithms, the embedded chain, and the number of bytes that follow the signed range.

An ordinary approval signature on a file with a 131-byte comment added afterwards is reported as intact while the file is flagged as changed, with annotations named as what was added. A certification signature that allows no changes (DocMDP level 1) gets a harsher verdict, Certification violated, because the same comment breaks its promise.

Key features

  • Finds every /ByteRange signature dictionary, up to 50, including certification signatures and standalone document timestamps
  • Hashes the covered bytes with SHA-1, SHA-256, SHA-384 or SHA-512 and compares the digest with the messageDigest signed attribute
  • Verifies the signature value for RSA with PKCS#1 v1.5 padding, RSA-PSS and ECDSA on P-256, P-384 and P-521 using the browser's WebCrypto
  • Reads RFC 3161 timestamp tokens, inside a signature or as a document timestamp, including the hash they stamp and the timestamp authority's own signature
  • Shows the signer's subject, issuer, validity dates, serial number, key, SHA-256 fingerprint, key usage and OCSP or CRL addresses
  • Describes what follows the signed range: later signatures, form fields, annotations, page objects and validation data

What is checked, and what a signature check cannot tell you

Signature dictionaries are found by scanning the raw bytes for /ByteRange, not by loading the document with a PDF library, so a file that is damaged elsewhere can still be checked. The dictionary text around each entry supplies the subfilter, reason, location, contact line, the /M date and any DocMDP certification level; strings are decoded from literal, hex and UTF-16 forms. Before anything is hashed the range itself is checked: it must start at byte 0, run in increasing order, stay inside the file, and the gap must be exactly a hex string in angle brackets that follows the /Contents key. A gap that encloses anything else is how signature-wrapping tricks work, so it is reported as an error.

Four subfilters are verified: adbe.pkcs7.detached, ETSI.CAdES.detached (checked as plain CMS, without the CAdES signing-certificate binding), adbe.pkcs7.sha1 (the SHA-1 stored in the signature is compared with the document first) and ETSI.RFC3161 document timestamps. The legacy adbe.x509.rsa_sha1 format holds a bare RSA value rather than CMS and is reported as not verifiable. MD5 and SHA-224 digests are not available in the browser, so those signatures are listed with the reason instead of a verdict. The same goes for RSA-PSS signatures whose MGF1 hash differs from the message hash (for example SHA-256 with MGF1-SHA1): WebCrypto cannot check them, so they are reported as not verifiable instead of broken.

The signing time can come from three places and the page says which it used: a verified timestamp token, which is the only one that comes from a third party (the page checks the token's own signature and that its certificate carries the timeStamping key usage, and a token edited after the authority signed it is rejected); the signingTime attribute inside the signed data, written by the signer's software; or the /M date in the dictionary, which the signature does not cover at all. The certificate's validity period is compared with whichever is present. A mismatch against a verified timestamp is an error, and against the other two a warning.

How it works

The CMS SignedData is read with a BER parser that keeps the offset of every element, so the signed attributes can be re-tagged as a SET (0x31, as RFC 5652 requires for the signed input) from the exact bytes in the file. Indefinite lengths, which some signing libraries write, are accepted.

The signer is matched to an embedded certificate by issuer and serial number or by subject key identifier. The digest of the covered bytes is computed with the signer's digest algorithm; with signed attributes it must equal the messageDigest attribute and the signature is verified over the re-tagged attributes, and without them the signature is verified over the covered bytes themselves.

Anything after the last covered byte is read as text: object headers, annotation, form-field and page dictionaries, further /ByteRange entries and /DSS data are counted and named.

Common use cases

  • A supplier returns a PDF with 'digitally signed' typed across the footer. The page finds no /ByteRange and says the file carries no cryptographic signature, only text or an image.
  • A certified PDF at DocMDP level 1 was opened in an editor and a note was added. The 131 bytes after the signed range contain a text annotation, and the badge reads Certification violated, because level 1 allows no changes at all. The summary CSV records the same verdict, certification-violated.
  • Three people countersigned a lease in turn. The page lists three signatures ordered by how much of the file each covers; only the last covers the whole file, and the first two show the later signatures as the bytes that follow them.

How to use this tool

  1. Drop the signed PDF onto the page; files up to 100 MB are read in memory.
  2. Read each signature panel from the top: the badge says whether the signed bytes and the signature value agree, and the notice under it says whether anything follows the signed range.
  3. Open the certificate rows to compare the SHA-256 fingerprint with one you were given by another route, then download the summary CSV if you need a record.

Example

Signed PDF (self-signed RSA 2048 certificate, SHA-256, adbe.pkcs7.detached)

contract.pdf with one signature in field Signature1, after one byte near the start of the file was changed

Report for Signature 1

Signature broken. The SHA-256 digest of the signed bytes does not equal the digest inside the signature. The signature value itself still verifies against the certificate's public key, so the signed attributes are genuine and only the document differs. The same file before the change shows Signature intact and a note that nothing was added after it.

Tips for best results

  • Compare the SHA-256 fingerprint of the signer certificate with one the signer reads out or e-mails separately. A self-signed certificate can carry any name, and the fingerprint is the only thing that ties it to a person.
  • Signatures are numbered by coverage, not by position in the file, so Signature 1 is always the earliest signed.
  • For a standalone timestamp (subfilter ETSI.RFC3161) the certificate shown belongs to the timestamp authority, and the hash checked is that of the document up to the timestamp.

Common pitfalls

Trust is not evaluated. A valid result means the key in the embedded certificate signed these bytes, not that an authority your organisation accepts vouches for that key.

Revocation is not checked and no network request is made, so a certificate revoked yesterday still shows as intact. Embedded OCSP or CRL data, in a /DSS dictionary or a revocation attribute, is only reported as present.

Later changes are described, not judged, with one exception: a DocMDP level 1 certification followed by anything other than validation data is reported as violated. Whether a form fill after a level 2 or 3 certification is permitted needs a full comparison of objects, and objects inside compressed object streams are not itemised.

The visible page is not compared with the signed content, so a shadow attack that changes what a page shows through a permitted later revision is not detected.

Common errors and how to fix them

"This is not a PDF file: there is no %PDF header in the first 1,024 bytes."
The file is another format or was renamed. Open it in a PDF reader first; a Word file saved with a .pdf extension gives this message.
"The /Contents value is all zero bytes: the field was reserved for a signature but never signed."
The document has an empty signature field, as blank forms do. Sign it in the application that created it; there is nothing to verify until then.
"The signature data could not be read: Truncated data at byte …"
The hex string in /Contents was cut short or edited, often by a tool that rewrote the file after signing. Ask the sender for the original file.

Best practices

  • Verify the copy you received, not one that has been opened and saved again: re-saving in an editor can append an update or rewrite the file and move the byte range.
  • Keep the summary CSV beside the signed file when it goes into a records system, so the digest and fingerprint you checked are on record.

What a ByteRange looks like

A signature dictionary might say /ByteRange [0 491 16877 137]. It means bytes 0 to 490 and 16877 to 17013 are signed, and the 16,386 bytes between them are the /Contents value: two angle brackets and 16,384 hex digits, which is 8,192 bytes reserved for the signature. The signer cannot put the signature inside the bytes it covers, so the file is written with a placeholder, hashed with the gap left out, and the signature is poured into the gap afterwards.

That arrangement explains both strengths and limits. Anything inside the two stretches cannot change without breaking the digest, but anything appended after the second stretch is outside it, which is how a later signer or a form fill adds to the file without disturbing earlier signatures.

Intact, broken or could not fully verify

The badge on each panel follows four rules:

  • Signature intact: the digest matches (or there are no signed attributes), the signature value verifies, and no certificate signature in the embedded chain failed.
  • Signature broken: the digest differs, the signature value fails, or the byte range is malformed.
  • Could not fully verify: the algorithm is unsupported here, the signer's certificate is not embedded, a timestamp-time check against a verified timestamp failed, or the signature field is empty.
  • Certification violated: the signature is a DocMDP level 1 certification and the file has later revisions that are more than appended validation data. A broken signature keeps the Signature broken badge.

Frequently asked questions

Why does a signature say intact while the file is flagged as changed?

The two statements are about different bytes. The signature covers only the stretches named in its /ByteRange, and anything added after them, such as a countersignature or a comment, leaves those stretches untouched.

Can this page confirm that a signature is legally valid or qualified?

No. A qualified electronic signature under eIDAS depends on the certificate being on a national trusted list and on revocation status at signing time, and this page checks neither. It confirms the cryptography only.

Why does a PDF with a drawn signature report no signature at all?

A picture of a handwritten signature, such as the one Sign PDF on this site places, is page content with no /ByteRange, so there is nothing to hash. The page says the file carries no cryptographic signature.

Does it work on encrypted PDFs?

Yes for the signature itself, because /Contents is never encrypted. Text in the signature dictionary, such as the reason, may come out garbled because those strings are encrypted with the document.