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.2). 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.1

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.1
File Size Uploaded
pdfsignerpy-0.3.1.tar.gz 46.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pdfsignerpy 0.3.1
File
pdfsignerpy-0.3.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
pdfsignerpy-0.3.1-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details
pdfsignerpy-0.3.1-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.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details

Total release size: 12.1 MB

Release files / pdfsignerpy-0.3.1.tar.gz

Download URL pdfsignerpy-0.3.1.tar.gz
Size 46.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4927758ab868555501c16e1c538650776fba87d9e9af0e4b7e888ff063050fd3
BLAKE2b-256 checksum
How to use checksums
42c0d541ebcb2b78803836b503a99442ada96fcaad0d026b862804d70a473a0a
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.1-cp39-abi3-win_amd64.whl

Download URL pdfsignerpy-0.3.1-cp39-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
90237bcad221961f69893b329501f252579fa734ced36fa32602317a3b239049
BLAKE2b-256 checksum
How to use checksums
1c8fcd4f3974c6b60afdd56df7aa2b39e1c24fc2801a807ff4b8ce13de54f1c4
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.1-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL pdfsignerpy-0.3.1-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
d443c00dbbd6e333672d3baa1995a054045434e100076cb7d7eb2d28e3159e67
BLAKE2b-256 checksum
How to use checksums
331423a9599b7fb813421b7da938d4d3c85b3eb53d2859ffbdd36f75dfa104c2
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.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pdfsignerpy-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.5 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e8a39a3dde5947d5c672b53e00a3260538955e4abd67e404f185996231ab62e8
BLAKE2b-256 checksum
How to use checksums
e74c701b10fc009a7f10f26807294c4a946f6b644831904104780ff7754df939
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.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL pdfsignerpy-0.3.1-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
423eae4a7c6647c6f5cd56d7c27ccfcd2dc4701eb60a08c7e1b838ba51ac6923
BLAKE2b-256 checksum
How to use checksums
1d1942d77e8ee68ec886365a7fe6f60b22ea79fecbb2eb604afd7f4da1f66495
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.1 This release

5 release files

0.3.0

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