Check if certificate is revoked using the x509 CRL extension
Project description
crl-checker
This small python library checks if a specific certificate is revoked using the CRL defined in the x509 CRL distribution points extension (https://datatracker.ietf.org/doc/html/rfc5280.html#section-4.2.1.13)
Installation
pip install crl-checker
Usage
Checking revocation using PEM encoded certificate
from crl_checker import check_revoked, Revoked, Error
cert_pem = """
-----BEGIN CERTIFICATE-----
<CERTIFICATE_PEM_BYTES>
-----END CERTIFICATE-----
"""
try:
check_revoked(cert_pem)
except Revoked as e:
print(f"Certificate revoked: {e}")
except Error as e:
print(f"Revocation check failed. Error: {e}")
raise
Checking revocation using an already loaded cryptography x509.Certificate:
from cryptography import x509
from crl_checker import check_revoked_crypto_cert, Revoked, Error
cert : x509.Certificate = ...
try:
check_revoked_crypto_cert(cert)
except Revoked as e:
print(f"Certificate revoked: {e}")
except Error as e:
print(f"Revocation check failed. Error: {e}")
raise
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
crl-checker-1.0.4.tar.gz
(6.5 kB
view hashes)
Built Distribution
Close
Hashes for crl_checker-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66a164d007e876790343a4b8e9fff04127275c53bf10954c910fac2d37fc111b |
|
MD5 | 1ee452921c517ac85c74f8aa5629625c |
|
BLAKE2b-256 | 49a824698278d0f4398198bc60b2385fd3d2b5554245e25d9bae73e15f3a3d2d |