How Digital Signatures Work in PDF: PKI Cryptography, Hashes & Document Integrity Verification
In business and legal environments, the term 'signature' is frequently applied to two vastly different concepts: pasting a PNG scan of a handwritten signature onto a page versus sealing a document with a Public Key Infrastructure (PKI) cryptographic digital signature. This technical guide explains how ISO 32000 digital signatures work under the hood, how the /ByteRange array creates a tamper-proof cryptographic seal, and how certificate validation works across global legal frameworks.
Key Technical Takeaways
- An electronic signature (such as a pasted bitmap image) provides zero mathematical proof against post-signing document tampering.
- A cryptographic digital signature uses asymmetric public-key cryptography (RSA/ECDSA) and cryptographic hashes (SHA-256) to seal the file.
- The PDF /ByteRange dictionary defines the exact byte offsets hashed by the signature, excluding only the signature container itself.
- Modifying even a single whitespace character or punctuation mark in a digitally signed PDF breaks the cryptographic hash, invalidating the seal.
Table of Contents
1. Electronic Signatures vs Cryptographic Digital Signatures
Pasting an image of a signature onto a PDF is visually appealing, but it provides zero forensic protection against fraudulent alteration. Only cryptographic digital signatures can mathematically prove that a contract has not been altered.
2. The Mathematical Foundation: Hashes and Asymmetric Keys
3. Inside the PDF Byte Stream: The /ByteRange Architecture
| Signature Parameter | PDF Dictionary Key | Function | Standard Used |
|---|---|---|---|
| Filter | /Filter | Specifies the signature handler | Adobe.PPKLite |
| SubFilter | /SubFilter | Encoding standard of signature payload | adbe.pkcs7.detached / ETSI.CAdES.detached |
| Byte Range | /ByteRange | Array defining exact byte regions covered by hash | ISO 32000-1 clause 12.8 |
| Certificate Chain | /Cert | X.509 public key certificate of signer | ITU-T X.509 v3 |
4. Certificate Authorities, Timestamping (TSA) & Long-Term Validation (LTV)
5. How PDF Readers Detect Document Tampering
Frequently Asked Questions
Can I add a password to a digitally signed PDF?▼
Encrypting a PDF with a password after it has been digitally signed alters the document byte stream, which breaks the cryptographic hash and renders the signature invalid. Any encryption must be configured during initial authoring before signing.
What happens if I use 'Merge PDF' or 'Rotate PDF' on a signed document?▼
Tools that modify page layout or re-serialize PDF byte streams will invalidate existing cryptographic digital signatures. Always perform merges, rotations, and page removals before applying final digital signatures.
Is an electronic signature image legally valid?▼
In many jurisdictions, simple electronic signatures are legally acceptable for basic agreements if both parties agree. However, for high-stakes transactions, real estate, and court filings, qualified cryptographic digital signatures are strictly required.
Does PDFDock store my private signing keys?▼
No. PDFDock runs 100% locally inside your client-side browser sandbox. No documents, keys, or certificates are ever uploaded or transmitted to external servers.
Recommended PDFDock Tools for This Guide
Encrypt your PDF with a secure user password to prevent unauthorized viewing.
Stamp a custom text overlay onto pages with adjustable size, color, opacity, and positioning.
Combine multiple PDF documents into a single file in any order you choose.
Extract specific page ranges or save every page as a separate PDF file.