PKI tools for e.g. checking certificate CRL/OCSP revocation
Project description
PKI tools exposes a high level cryptography
API for e.g.:
- checking revocation of certificates:
- using CRL defined in the x509 CRL distribution points extension (https://datatracker.ietf.org/doc/html/rfc5280.html#section-4.2.1.13)
- using OCSP defined in the x509 Authority Information Access extension (https://datatracker.ietf.org/doc/html/rfc5280.html#section-4.2.2.1)
- loading certificates from PEM format
- saving certificates to files
- reading certificates from files
Docs
Documentation is available at: https://pki-tools.fulder.dev
Quickstart
Install
pip install pki-tools
Usage
Checking OCSP and CRL revocation
from pki_tools import is_revoked
from pki_tools.types import PemCert, Chain
cert_pem = """
-----BEGIN CERTIFICATE-----
<CERT_PEM_BYTES>
-----END CERTIFICATE-----
"""
issuer_cert_pem = """
-----BEGIN CERTIFICATE-----
<ISSUER_CERT_PEM_BYTES>
-----END CERTIFICATE-----
"""
chain = Chain.from_pem([PemCert(issuer_cert_pem)])
if is_revoked(PemCert(cert_pem), chain):
print("Certificate Revoked!")
For more functions see: Pki Tools
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.19.tar.gz
(10.4 kB
view hashes)
Built Distribution
pki_tools-0.0.19-py3-none-any.whl
(12.2 kB
view hashes)
Close
Hashes for pki_tools-0.0.19-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce08bccd3355a549be308335b76da4b9d887156d00e097507d38f897b3cf4d23 |
|
MD5 | 36225782fde5bc0f5ed1e25cf9bb64ff |
|
BLAKE2b-256 | 7e7e6ed3df050aa7a0cf5b7882f34f90701b975c49d6eedd8c5ef9c470d6379d |