Overview of pyHanko features
masterpyHanko functions as both a Python library and a command-line tool (distributed via pyhanko-cli). Key capabilities include:
Stamping
- Simple text-based stamps and QR stamps.
- Support for monospaced or embedded TTF/OTF fonts (requires
[opentype]dependency).
Document Preparation
- Adding empty signature fields to existing PDFs.
- Adding seed values to signature fields (with or without constraints).
- Managing document metadata.
Signing
- Supports invisible signatures or visible appearances via stamping tools.
- LTV (Long Term Validation): Supports PAdES baseline profiles B-B, B-T, B-LT, and B-LTA, including Adobe-style revocation info embedding.
- Algorithms: RSA (PKCS#1 v1.5 and RSASSA-PSS), DSA, ECDSA, EdDSA (Ed25519 and Ed448), and ML-DSA.
- Integrity: Supports multiple signatures using incremental updates.
- Advanced Features: RFC 3161 timestamp server support, PKCS#11 support, and an "interrupted signing" mode for remote/interactive processes.
Signature Validation
- Cryptographic integrity and X.509 chain of trust validation.
- Difference analysis for files with multiple signatures or incremental updates.
- AdES validation and validation against EU trusted lists.
Encryption
- Supports PDF 2.0 encryption methods and authenticated encryption (ISO/TS 32003/32004).
- Supports RSAES-OAEP and ephemeral-static ECDH with X9.63 key derivation.
CLI & Configuration
- YAML-based configuration.
- CLI built on
click. Usepyhanko --helpfor assistance.