--- id: pyhanko version: "0.36.2" license: MIT license_treatment: permissive maintenance: active --- # pyHanko — Tools for stamping and signing PDF files License: permissive · Maintenance: active · Downloads: 9.0M/mo ## What it is and what it does pyHanko is a library for working with digital signatures in PDF documents. It handles signing, stamping, and validating PDF signatures according to standards like PAdES, and supports hardware tokens via PKCS#11. The library depends on cryptography, lxml, requests, and certificate validation tools to perform its core operations. The package is designed for developers who need to integrate PDF signing into Python applications. It requires Python 3.10 or later and offers optional features for image handling, QR codes, and OpenType font support. The CLI functionality has been separated into a standalone package (pyhanko-cli), so this distribution focuses purely on the library API. Use it for: - Add digital signatures to PDF documents programmatically in a Python application - Validate existing PDF signatures to verify authenticity and integrity - Implement PAdES-compliant signing workflows for legal or compliance requirements - Integrate hardware security module (HSM) signing via PKCS#11 support - Batch process PDF documents to apply timestamps or signatures at scale ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. pyHanko is a Python library for adding, validating, and managing digital signatures in PDF documents, supporting standards like PAdES and PKCS#11. Yes. Active maintenance, permissive MIT license, low install friction, no known vulnerabilities, and a focused scope make this a solid choice for PDF signature work. The separation of CLI into a separate package keeps the library dependency footprint lean. Verify whether optional dependencies match your use case before installing. ## Install pip install pyhanko uv add pyhanko poetry add pyhanko ## Installing pyHanko Before you install: Low install friction with a pure-wheel distribution. Actively maintained with a recent release (19 days old) and steady commit activity. Supports modern Python versions (3.10 through 3.14). License in practice: MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install pyhanko from pyhanko.pdf_utils import writer from pyhanko.sign import signers # Sign a PDF with a certificate signer = signers.SimpleSigner.load(...) w = writer.PdfFileWriter() w.sign(signers.PdfSignatureMetadata(field_name='Signature1'), signer=signer) Requires Python 3.10 or later. Certificate and key files needed for signing operations. Verify before relying: - Whether optional dependencies (pkcs11, image-support, opentype, qr) are required for typical use cases or truly optional - Performance characteristics when handling large PDF documents or batch signing operations - Whether the library handles all PDF signature standards or has known limitations ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 9.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pdf digital signature, sign pdf files, pdf signature validation, pades signing, cryptographic pdf stamps, pdf-signing, digital-signatures, pades [View on SkillFed](https://skillfed.io/packages/pyhanko) · [View on PyPI](https://pypi.org/project/pyhanko/)