Skip to main content

Build Status codecov.io

An unofficial wrapper to query crt.sh.

Installation

The package can be installed from PyPI

pip install certificate-search

Usage

import json

from cryptography.x509.oid import NameOID, ExtensionOID
from cryptography.x509.general_name import DNSName

from crt.search import CertificateSearch, SUPPORTED_SITES

# Print the list of all supported sites
print(json.dumps(SUPPORTED_SITES))

engines = CertificateSearch()

domains = [
    'github.com',
    'facebook.com',
]

for domain in domains:
    for cert in engine.search(domain=domain):
        not_before = cert.not_before
        not_after = cert.not_after

        pem = cert.pem
        # An x509 certificate
        common_name = pem.subject.get_attributes_for_oid(NameOID.COMMON_NAME)[0].value
        country_name = pem.subject.get_attributes_for_oid(NameOID.COUNTRY_NAME)[0].value
        organization_name = pem.subject.get_attributes_for_oid(NameOID.ORGANIZATION_NAME)[0].value

        # All SAN records
        san = pem.extensions.get_extension_for_oid(ExtensionOID.SUBJECT_ALTERNATIVE_NAME)
        san_names = san.value.get_values_for_type(DNSName)

Metadata

Release files for certificate-search 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for certificate-search 0.3
File Size Uploaded
certificate-search-0.3.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for certificate-search 0.3
File Interpreter ABI Platform
certificate_search-0.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 8.8 kB

Release files / certificate-search-0.3.tar.gz

Download URL certificate-search-0.3.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e27c9657febf9cffaa9b06a95c4f3decdf76f7066755247ef48c0d61a8b15629
BLAKE2b-256 checksum
How to use checksums
13c83bacb95c579800e5a8f29086d0cd8edb8e4ffb0c33a97329de234da78ee7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.12.5 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

Release files / certificate_search-0.3-py2.py3-none-any.whl

Download URL certificate_search-0.3-py2.py3-none-any.whl
Size 4.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f733dc7383d4cb3dfe1ebb4502097d2af110075c6ca30ed8aa11f6c1186c896f
BLAKE2b-256 checksum
How to use checksums
e57d40549bfa7c86e93d0e1f1cfa381cc6c3c98c0617adba725586ff1b713f21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.12.5 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page