Skip to main content

PKI tools for e.g. checking certificate CRL/OCSP revocation

Project description

Python Badge

pki-tools

PKI tools exposes a high level cryptography API for e.g.:

Installation

pip install pki-tools

Usage

See Documentation for available functions.

Examples

Checking OCSP and CRL revocation

The following examples uses PEM strings for certificate and issuer. Note that it's possible to use x509.Certificate parameters instead as well as OcspIssuerUri type for the issuer in order to download and cache the issuer certificate.

from pki_tools import is_revoked
from pki_tools.types import PemCert

cert_pem = """
-----BEGIN CERTIFICATE-----
<CERT_PEM_BYTES>
-----END CERTIFICATE-----
"""
issuer_cert_pem = """
-----BEGIN CERTIFICATE-----
<ISSUER_CERT_PEM_BYTES>
-----END CERTIFICATE-----
"""

if is_revoked(PemCert(cert_pem), PemCert(issuer_cert_pem)):
    print("Certificate Revoked!")

Project details


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.7.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

pki_tools-0.0.7-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page