A
PDF digital signature is created through a process involving asymmetric cryptography:
1. Key pair — The signer possesses a private key (kept secret, stored on a smart card, HSM, or software token) and a corresponding public key embedded in an X.509 certificate issued by a trusted Certificate Authority (CA).
2. Byte range hash — When signing, the PDF viewer/signing tool calculates a cryptographic hash (SHA-256 or better) of specific byte ranges of the PDF file — all bytes except the signature value itself (which is not yet known). The specific byte ranges are specified in the
/ByteRange entry in the signature dictionary.
3. PKCS#7 / CMS signature — The hash is encrypted with the signer's private key, producing the signature value. This value, together with the signing certificate, timestamp, and optional additional data, is packaged as a PKCS#7/CMS (Cryptographic Message Syntax) structure. In PDF, this is stored in the
/Contents entry of the signature dictionary.
4. Verification — Any recipient can verify: (a) the certificate chain is valid and trusted; (b) the certificate was not revoked at signing time (via OCSP or CRL); (c) decrypting the signature value with the public key produces the same hash as independently computed from the document bytes; (d) the document has not been modified since signing.
Signature types:
-
Approval signature — Indicates the signer approves the document's current content
-
Certification signature (DocMDP) — Certifies the document with restrictions on what future modifications are permitted; only one can exist per document
-
Usage rights signature — Grants extended rights (enabling usage-rights features in Acrobat Reader)
-
Timestamp signature — A trusted timestamp from a TSA (Timestamp Authority) proving the document existed at a specific time