Skip to main content

pdfsigner (Python)

PyPI Python versions Downloads CI License: GPL v3 powered by pdf_signer DOI

Digitally sign and verify PDF documents — full PAdES (ETSI EN 319 142) from B-B to B-LTA — with a single, dependency-free wheel. No Java, no OpenSSL, no Poppler, no system libraries.

pip install pdfsignerpy      # pre-built wheels — no compiler, no Rust needed
import pdfsigner
pdfsigner.sign_pdf("in.pdf", "out.pdf", "keystore.p12", "password")
print(pdfsigner.verify_pdf("out.pdf")[0]["valid"])   # True

Why pdfsigner?

Most Python PDF-signing libraries lean on heavy native stacks — OpenSSL via cryptography, a Java runtime, or external tools like Poppler. pdfsigner bundles the entire crypto + PDF pipeline as one self-contained Rust extension (the pure-Rust pdf_signer crate, wrapped with PyO3).

  • 🦀 Zero system dependencies — no OpenSSL, no Java, no Poppler, no cffi. One wheel, nothing to apt-get.
  • 📦 Pre-built wheels for Linux (x86_64 · aarch64), macOS (Intel · Apple Silicon, universal2) and Windows — pip install and go, no Rust toolchain.
  • 🔏 Real PAdES, B-B → B-LTA — CAdES signing-certificate-v2, RFC 3161 signature and document timestamps, and long-term validation (/DSS with the chain, CRLs and OCSP).
  • ✅ Verification you can trust — RFC 5280 path validation whose name constraints and certificate-policy engine are validated against the NIST PKITS suite (42/42 policy + 38/38 name-constraint tests).
  • 🔑 Modern keys — RSA, ECDSA (P-256/P-384) and Ed25519; CRL + OCSP revocation.
  • 🖋 Rich visible signatures — a bordered box with an embedded TrueType/OpenType font and a PNG/JPEG logo, placed anywhere on any page.
  • 🧩 Incremental updates — sign repeatedly; earlier signatures stay valid.
  • 🔁 One engine, two languages — the same backend powers the pdfsigner R package.

Installation

pip install pdfsignerpy

Wheels are published for common platforms, so installation needs no compiler and no Rust. To build from source on an unsupported platform, install a Rust toolchain from https://rustup.rs first (pip will compile it automatically).

The PyPI distribution is pdfsignerpy, but you import pdfsigner (the name pdfsigner is blocked on PyPI as too similar to pdf-signer).

Usage

import pdfsigner

# Sign (invisible). Levels above "bb" need a tsa_url.
pdfsigner.sign_pdf(
    "input.pdf", "signed.pdf", "keystore.p12", "password",
    reason="Approval",
    level="bb",                     # bb | bt | blt | blta
)

# Sign with a visible box, an embedded font and a logo.
pdfsigner.sign_pdf(
    "input.pdf", "signed.pdf", "keystore.p12", "password",
    signtext="Digitally signed",
    font="Arial.ttf",
    image="logo.png",
    level="blta",
    tsa_url="http://timestamp.digicert.com",
)

# Verify every signature.
for s in pdfsigner.verify_pdf("signed.pdf"):
    print(s["valid"], s["signer"], s["detail"])

# Verify and validate the signer chain against trusted roots (e.g. ICP-Brasil).
pdfsigner.verify_pdf("signed.pdf", roots="icp-brasil-roots.pem")

# The whole-document verdict: every signature valid and trusted, and nothing
# changed after the last signature (apart from a PAdES /DSS).
report = pdfsigner.verify_pdf_report("signed.pdf", roots="icp-brasil-roots.pem")
print(report["document_intact"], report["all_trusted"])

verify_pdf returns one dict per signature or document timestamp with keys: valid, is_timestamp, signer, chain_trusted (bool or None when no roots given), covers_whole_document, trusted_time (epoch seconds of the trusted RFC 3161 time the chain was judged at, or None), signed_len, byte_range and detail. verify_pdf_report wraps that list as signatures together with document_intact, all_valid and all_trusted — use it for a pass/fail decision: a PDF whose content was changed by an unsigned incremental update after signing keeps valid signatures but is not intact.

Architecture

pdfsigner (Python) architecture: the Python API (sign_pdf / verify_pdf) calls a PyO3 extension module, which links the pure-Rust pdf_signer crate and its dependencies, producing PAdES-signed PDFs and a verification report.

import pdfsigner calls a thin PyO3 extension module that links the pure-Rust pdf_signer crate (a git dependency pinned to v0.3.1). The same engine powers the pdfsigner R package.

Authors

  • André Leite — Universidade Federal de Pernambuco (maintainer)
  • Hugo Vasconcelos — Universidade Federal de Pernambuco
  • Diogo Bezerra — Universidade Federal de Pernambuco
  • Marcos Wasiliew — Universidade Federal de Pernambuco
  • Carlos Amorim — Universidade Federal de Pernambuco

Citation

If you use this software, please cite it using the metadata in CITATION.cff.

License

GPL-3.0-or-later. The bundled pdf_signer crate and its Rust dependencies retain their own (permissive) licenses.

Release files for pdfsignerpy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdfsignerpy 0.3.0
File Size Uploaded
pdfsignerpy-0.3.0.tar.gz 48.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pdfsignerpy 0.3.0
File
pdfsignerpy-0.3.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
pdfsignerpy-0.3.0-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details
pdfsignerpy-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
pdfsignerpy-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.9 abi3 macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64 Details

Total release size: 12.1 MB

Release files / pdfsignerpy-0.3.0.tar.gz

Download URL pdfsignerpy-0.3.0.tar.gz
Size 48.7 kB
Tags Source
SHA-256 checksum
How to use checksums
90e3706874742df544c20988453272bdb65de85a31a2703e004693e6ac4737fc
BLAKE2b-256 checksum
How to use checksums
4d534f354e32c0180256f24cebdfd8c9ede211a4e1617be53ccc3bb97f0d910c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / pdfsignerpy-0.3.0-cp39-abi3-win_amd64.whl

Download URL pdfsignerpy-0.3.0-cp39-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
de1a1abf89ebacfd5a29b11409bd9897523be96e5600d386dcf46a27ff8f94e7
BLAKE2b-256 checksum
How to use checksums
a690797329d2bc05a7358df26000be909c7f052a3252c9053265da035923d60c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / pdfsignerpy-0.3.0-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL pdfsignerpy-0.3.0-cp39-abi3-manylinux_2_28_aarch64.whl
Size 2.4 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
381b5d2b9f13ed09d11a58f699782f77dff5d0cfde0bc2171bd296336f6d3dc7
BLAKE2b-256 checksum
How to use checksums
dde16a3063e183afab0e49e3f0c7c65c2405641e65d8b16c7d0d551742d53cc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / pdfsignerpy-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pdfsignerpy-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.6 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8cb0e14335c952c995c8b68698c4cc431282a163c51e8154138ac5830bc043a2
BLAKE2b-256 checksum
How to use checksums
b7651b841a44f8a75d068ff81ccd0ce0c9830756c42abeec8c32b9c86ed608f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / pdfsignerpy-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL pdfsignerpy-0.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 4.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
19eedf480065f68c95f0dd3844829ccad21d9bd3c7b826bbbba3be851f61124f
BLAKE2b-256 checksum
How to use checksums
8a6c7f7a9e7918c98886c9365c71b5ee1b5b7b6aba9db593ad8d0864fde14334
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

5 release files

0.2.1

5 release files

0.1.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page