A Python utility for analyzing X.509 certificates. This tool can inspect individual certificate files or recursively scan directories for certificates, providing detailed information about each certificate found.
- Analyze single certificate files or entire directories
- Support for multiple certificate formats (.pem, .crt, .cer, .der)
- Display key certificate information:
- Subject Common Name
- Full subject details
- Issuer information
- Validity period
- Current validity status
- Python 3.6+
- cryptography library
Install the required dependency using pip:
pip install cryptographypython cert-inspector.py <path_to_certificate_or_directory>Analyze a single certificate:
python cert-inspector.py /path/to/certificate.pemScan a directory for certificates:
python cert-inspector.py /path/to/certificates/directoryFor each certificate, the tool displays:
- File path
- Certificate subject (Common Name)
- Complete subject information
- Issuer details
- Validity period
- Current status (VALID, EXPIRED, or NOT YET VALID)
- .pem - Privacy Enhanced Mail certificates
- .crt - Certificate files
- .cer - Certificate files
- .der - DER encoded certificates
The tool provides error messages for:
- Invalid file paths
- Malformed certificates
- Directories with no certificate files
- Incorrect usage