Certificate Transparency search
Project description
Certificate Search
An unofficial wrapper to query crt.sh.
Installation
The package can be installed from PyPI
pip install crt-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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
certificate-search-0.1.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for certificate_search-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ec85d0d724057e00f4f367c2045585ff6b87998063cb70cf3a748c9b695f31a |
|
MD5 | 64c8692b82de71c321413edf7cd803f2 |
|
BLAKE2b-256 | d2171bbbd0a266389f8e0d0aeeb386d5609279b241e64265d35a727e4b7f6786 |