PKI tools for e.g. checking certificate CRL/OCSP revocation
Project description
PKI tools exposes a high level cryptography
API for e.g.:
- Loading certificates from PEM strings/files/cryptography object into a pydantic model including all x509 v3 extensions
- Checking revocation of certificates using OCSP with CRL fallback
Docs
Documentation is available at: https://pki-tools.fulder.dev
Quickstart
Install
pip install pki-tools
Usage
Loading certificate
from pki_tools import Certificate
cert_pem = """
-----BEGIN CERTIFICATE-----
<CERT_PEM_BYTES>
-----END CERTIFICATE-----
"""
cert = Certificate.from_pem_string(cert_pem)
Loading chain
from pki_tools import Chain
issuer_cert_pem = """
-----BEGIN CERTIFICATE-----
<ISSUER_CERT_PEM_BYTES>
-----END CERTIFICATE-----
"""
chain = Chain.from_pem_string(issuer_cert_pem)
Checking revocation using OCSP with CRL fallback
The following example is using the cert
and chain
from the examples above
from pki_tools import is_revoked
if is_revoked(cert, chain):
print("Certificate Revoked!")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pki_tools-0.0.28.tar.gz
(16.2 kB
view hashes)
Built Distribution
pki_tools-0.0.28-py3-none-any.whl
(21.1 kB
view hashes)
Close
Hashes for pki_tools-0.0.28-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5f89511e0d9651439177fcb1c2f54404b6f3aa3cbcf0f949a28e6f18e47cb6e |
|
MD5 | 38c6655f642f22ac3e94d7b10c49df68 |
|
BLAKE2b-256 | 53a6cda29b19a9bf1dbcdad5176ee7469c24c33816812a779d04ae8e7e28049f |