Skip to main content

The cross-platform tool to get certificate info (including self-signed).

Project description

PyPI version Build Status

Certificate

The cross-platform tool to get certificate info (including self-signed).

Installation

For most users, the recommended method to install is via pip:

pip install pycert

Import

from pycert import CertClient

Usage

Command from usual user:

from pycert import CertClient

client = CertClient(host="172.16.0.124")
print(client.get_all_info())
from pprint import pprint
from pycert import CertClient

cert = CertClient('pypi.org')

pprint(cert.get_all_info())
{
  "version": "v3",
  "valid_from": "2021-10-22T18:41:11",
  "valid_to": "2022-11-23T18:41:10",
  "is_valid": true,
  "is_self_signed": false,
  "issuer": {
    "C": "BE",
    "O": "GlobalSign nv-sa",
    "CN": "GlobalSign Atlas R3 DV TLS CA H2 2021"
  },
  "subject": {
    "CN": "www.python.org"
  },
  "signature_algorithm": "sha256",
  "serial_number": "1B7C6CD03E8E071BE48C2B1A7994075",
  "alternative_name": [
    "DNS:www.python.org",
    "DNS:*.python.org",
    "DNS:docs.python.org",
    "DNS:downloads.python.org",
    "DNS:pypi.python.org"
  ],
  "fingerprint": "CE1F8748D2DA0265B329F1DFD70047DCEF6CD8FB"
}

Useful links

Changelog:

unreleased
1.0.3 (4.06.2022)
  • Log name changed to CertClient
  • Log format changed according other modules
1.0.2 (17.04.2022)
  • External logger added
1.0.1 (14.12.2021)
  • refactored "get_all_info": not it gets issuer and subject dynamically
  • get_serial_number: returns upper hexadecimal without first bit now
  • is_self_signed: preliminary method added (can be changed in future)
  • get_all_methods fixed: now it returns CertClient methods
  • get_alt_name refactored to get extension using oid
1.0.0 (8.12.2021)
  • New method added: get_fingerprint()
  • get_all_info() extended with thumbprint, added params (fp_brief=True, signature_algorithm_brief=True)
  • get_signature_algorithm() updated to return full or brief signature info
0.0.12 (30.11.2021)
  • example added
0.0.1 (30.11.2021)
  • initial commit

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

pycert-1.0.4.tar.gz (17.3 kB view hashes)

Uploaded Source

Built Distribution

pycert-1.0.4-py3-none-any.whl (17.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