Discord Coverage

PKI Tools

pki-tools logo

PKI tools exposes a high level cryptography API and wrappers 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
  • Creating Certs, CSR, CRL easy with pure pydantic objects to e.g. get a PEM file

Install

pip install pki-tools

Chat

Discord Chat

Log level

pki-tools use loguru library for logging. Where the default log level is DEBUG, if you want to change it you could e.g. use the LOGURU_LEVEL environment variable.

Features

Creating x509 objects

Certificate CertificateSigningRequest Chain OCSP
Create Self Signed
Create Cross Signed
Create and sign Create from certificates Create request
Create response
DSA EllipticCurve ED448 ED25519 RSA
generate generate generate generate generate

Loading x509 objects

Certificate CertificateSigningRequest Chain OCSP
from_pem_string from_pem_string from_pem_string Request.from_pem_string
Response.from_pem_string
from_file from_file from_file Request.from_file
Response.from_file
from_cryptography from_cryptography from_cryptography Request.from_cryptography
Response.from_cryptography
from_uri N/A from_uri N/A
from_server N/A N/A N/A
DSA EllipticCurve ED448 ED25519 RSA
from_pem_string from_pem_string from_pem_string from_pem_string from_pem_string
from_file from_file from_file from_file from_file
from_cryptography from_cryptography from_cryptography from_cryptography from_cryptography

Saving x509 objects

Certificate CertificateSigningRequest Chain OCSP
to_file to_file to_file Request.to_file
Response.to_file
DSA EllipticCurve ED448 ED25519 RSA
to_file to_file to_file to_file to_file