pyhanko-certvalidator
Validates X.509 certificates and paths; forked from wbond/certvalidator
What it is and what it does
pyhanko-certvalidator is a Python library for validating X.509 certificate chains, originally forked from wbond/certvalidator but significantly evolved for use in pyHanko. It performs comprehensive path validation including signature verification (RSA, DSA, ECDSA, EdDSA), name chaining, validity date checks, and extension processing. The library supports revocation verification through both CRL (including indirect and delta CRLs) and OCSP (including delegated responders), with configurable failure modes and response caching. It can validate certificates at a specific point in time, enforce name constraints, and handle attribute certificates.
The library has been refactored to use asynchronous I/O throughout, though synchronous wrappers remain available for backward compatibility. It depends on asn1crypto, cryptography, oscrypto, uritools, and requests. The default OCSP and CRL clients use requests for HTTP operations, with an optional aiohttp-based implementation available for more efficient async use. Bug reports and questions are routed through the pyHanko project rather than this repository directly.
Use it for:
- Validate certificate chains in PKI-aware applications before trusting certificates for TLS or code signing
- Perform revocation checks via CRL or OCSP to ensure certificates have not been compromised or revoked
- Validate certificates as they were at a specific historical date for compliance or forensic purposes
- Enforce certificate policy constraints and name constraints in security-critical workflows
- Build certificate path validation into document signing or verification tools (e.g., PDF signing)
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Validates X.509 certificate paths with support for revocation checks (CRL and OCSP), point-in-time validation, and policy constraints.
Yes. The package is actively maintained, has no known vulnerabilities, supports current Python versions, and provides comprehensive X.509 validation with low install friction. Suitable for production use in PKI-aware applications. Note that the synchronous API is deprecated in favor of async equivalents, so new code should plan for async patterns.
Install
pyhanko-certvalidator on PyPI
pip
pip install pyhanko-certvalidatoruv
uv add pyhanko-certvalidatorpoetry
poetry add pyhanko-certvalidatorInstalling pyhanko-certvalidator
Before you install
Low friction install with five stable runtime dependencies. Actively maintained with a release within the past month and recent commits. Supports current Python versions (3.10+).
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install pyhanko-certvalidator
from pyhanko_certvalidator import CertificateValidator
validator = CertificateValidator()
# Use validator.validate_usage() or async equivalents for certificate validation
Requires Python 3.10 or higher. Most high-level APIs are now async-first; synchronous wrappers exist but are deprecated.
Verify before relying
- Whether the synchronous API wrappers are stable enough for production use despite deprecation status
- Performance comparison between requests-based (default) and aiohttp-based OCSP/CRL clients
- Completeness of documentation for migration from synchronous to async patterns
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — asn1crypto, oscrypto, cryptography, uritools, requests |
| Maintenance | actively maintained — 20 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,294,287/month — #1,937 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyhanko_certvalidator-0.31.4-py3-none-any.whl
Keywords: crypto, pki, x509, certificate, crl, ocsp
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
certvalidatorValidates X.509 certificates and certificate…
permissive · top 15,000 on PyPI
ocspbuilderocspbuilder creates and signs OCSP requests and…
permissive · top 5,000 on PyPI
ocspresponderImplements an RFC 6960 compliant OCSP Responder…
permissive · top 5,000 on PyPI
aiaBuilds and validates TLS certificate chains by…
permissive · top 15,000 on PyPI
openssl-ocsp-responderWraps OpenSSL's command-line OCSP responder to…
permissive · top 15,000 on PyPI
wincertstoreAccesses Windows system certificate stores (CA…
permissive · top 15,000 on PyPI
truststoreTruststore exposes native system certificate…
permissive · top 1,000 on PyPI
pyHankopyHanko is a Python library for adding,…
permissive · top 5,000 on PyPI
service-identityVerifies that cryptography or pyOpenSSL…
permissive · top 5,000 on PyPI
asn1cryptoA pure Python library for parsing and…
permissive · top 1,000 on PyPI