Skip to main content

Display X.509 certificate information from piped input

Project description

cert-piper

A command-line tool for displaying X.509 certificate information from piped input.

Pipe any PEM certificate file (or a base64-encoded certificate) into cert-piper and get a rich, colour-coded summary of every certificate in the stream — including validity, key details, SANs, fingerprints, and more.

Requires Python 3.6 or later.

Note for developers: building from source requires Python 3.7+ because the build toolchain (setuptools >= 61, setuptools-scm >= 8) does not run on Python 3.6. Installing a pre-built wheel from PyPI works on Python 3.6+.


Features

  • Pipe-friendly — reads from stdin, works naturally with cat, curl, openssl, etc.
  • Batch support — handles PEM bundles with multiple certificates in a single stream
  • Base64 detection — automatically detects and decodes base64-encoded PEM or DER input
  • Rich output — colour-coded expiry status, structured sections, emojis
  • --paging option — scroll through long output with a built-in pager
  • Semver versioning — published to PyPI from git tags via GitHub Actions

Installation

pip install cert-piper

Or install from source:

git clone https://github.com/tkdpython/cert-piper.git
cd cert-piper
pip install -e .

Usage

# Single certificate
cat mycert.pem | cert-piper

# Run as a Python module
cat mycert.pem | python3 -m cert_piper

# PEM bundle (multiple certificates in one file)
cat bundle.pem | cert-piper

# Base64-encoded certificate (auto-detected and decoded)
cat encoded.b64 | cert-piper

# Paged output for large bundles
cat bundle.pem | cert-piper --paging

# Fetch a remote certificate via openssl
openssl s_client -connect example.com:443 -showcerts </dev/null 2>/dev/null | cert-piper

# Show version
cert-piper --version

What It Shows

For each certificate in the stream:

Section Details
Subject Common Name, Organisation, Country, etc.
Issuer Same fields as Subject
Validity Not Before / Not After, days remaining, expiry status (🟢 valid / 🟡 expiring / 🔴 expired)
Public Key Algorithm (RSA / EC / Ed25519 / …), key size, signature algorithm
SANs DNS names, IP addresses, email addresses, URIs
Key Usage Key Usage and Extended Key Usage flags
OCSP / Revocation OCSP URLs, CA Issuers URLs, CRL Distribution Points, OCSP Must-Staple
Fingerprints SHA-256 and SHA-1
Additional Details Serial number, self-signed status, CA flag, path length, Subject/Authority Key IDs

Base64 Detection

If no PEM -----BEGIN CERTIFICATE----- headers are found in the input, cert-piper will automatically attempt to base64-decode the input and retry. This handles:

  • PEM data that has been base64-encoded (e.g. copied from a Kubernetes secret)
  • Raw DER certificate bytes that have been base64-encoded

When base64 decoding is applied a notice is printed:

(base64-encoded input detected and decoded)

Publishing

Releases are published to PyPI automatically when a semver git tag is pushed:

git tag v1.0.0
git push origin v1.0.0

The version is derived from the git tag via setuptools-scm.

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

cert_piper-0.2.0.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cert_piper-0.2.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file cert_piper-0.2.0.tar.gz.

File metadata

  • Download URL: cert_piper-0.2.0.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cert_piper-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7a18c479d2b474a654e6f169fbfed92b4010e3532ab1ee55f26c9c7c6cb20d85
MD5 2dfbddbf37bec47e06744026efc6bc99
BLAKE2b-256 05e290135f7c32af351eff3e8d972916f9ed7d5e10fc5c6ba65d4d769dc188ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for cert_piper-0.2.0.tar.gz:

Publisher: publish.yml on tkdpython/cert-piper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cert_piper-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cert_piper-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cert_piper-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afa1904804943f74c89f9f978e29b0b32bf70a3e4a64ea6048572164facaccf9
MD5 11d2761b8096065de6bf44f99c05097c
BLAKE2b-256 0ebfdd880364c223b55ff3f71b5ecc0c0a2126f8ae8276cc103d57e8a8083f4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cert_piper-0.2.0-py3-none-any.whl:

Publisher: publish.yml on tkdpython/cert-piper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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