Skip to content

PKI tools for easy certificate management, checking CRL/OSCP status and more

License

Notifications You must be signed in to change notification settings

fulder/pki-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Badge

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(cert_pem)

Loading chain

from pki_tools import Chain

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

chain = Chain.from_pem(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!")

About

PKI tools for easy certificate management, checking CRL/OSCP status and more

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages