Skip to content

feat: Digital signatures (ISO 32000-2 §12.8) (Block H) #36

@ralflang

Description

@ralflang

Digital Signatures

Implement PDF digital signature support (PKCS#7/CMS detached signatures).

Signature field: a widget annotation with /FT /Sig and /V pointing to a signature dictionary.

Signature dictionary: /Type /Sig, /Filter /Adobe.PPKLite, /SubFilter /adbe.pkcs7.detached, /ByteRange, /Contents.

Signing workflow:

  1. Serialize PDF with placeholder /Contents and /ByteRange
  2. Compute byte range (everything except /Contents value)
  3. Hash and sign with private key
  4. Insert signature into placeholder

Requires incremental update capability (PdfReader + append) for signing existing documents.

PAdES (PDF Advanced Electronic Signatures) profile for EU/legal compliance as stretch goal.

Tests: signature dictionary present, byte range covers correct regions, PKCS#7 structure valid, signed PDF verifiable with openssl.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions