Skip to main content

A library for using DANE TLSA records for certificate discovery.

Documentation Status https://circleci.com/gh/ValiMail/dane-discovery.svg?style=shield Maintainability Test Coverage

Quick Start

Installation

pip install dane-discovery

Load a certificate from DNS and print the PEM representation

from dane_discovery.dane import DANE
from dane_discovery.pki import PKI
dns_name = "dns.name.having.a.tlsa.record"
tlsa_record = DANE.get_first_leaf_certificate(dns_name)
if not tlsa_record:
    raise ValueError("No leaf certificate found for {}.".format(dns_name))

der_cert = PKI.certificate_association_to_der(tlsa_record["certificate_association"])
print(PKI.der_to_pem(der_cert))

Load a DANE identity from DNS and print the request context

from dane_discovery.identity import Identity
dns_name = "dns.name.having.a.tlsa.record"
dane_identity = Identity(dns_name)
print(dane_identity.report())

Name: abc123.air-quality-sensor._device.example.net
Request context:
  DNSSEC: False
  TLS: False
  TCP: True
Credential index: 0
  certificate usage: DANE-EE
  selector: Full certificate match
  matching type: Exact match against certificate association
  x509 attributes:
    {'extensions': {'BasicConstrints': {'ca': False, 'path_length': None},
                    'KeyUsage': {'content_commitment': True,
                                 'crl_sign': False,
                                 'data_encipherment': False,
                                 'digital_signature': True,
                                 'key_agreement': False,
                                 'key_cert_sign': False,
                                 'key_encipherment': True}},
     'subject': {'commonName': 'abc123.air-quality-sensor._device.example.net',
                 'countryName': 'US',
                 'organizationName': 'Example Networks',
                 'stateOrProvinceName': 'CA'}}

More examples

Metadata

Release files for dane-discovery 0.22

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

Source distribution (sdist)

Source distribution for dane-discovery 0.22
File Size Uploaded Provenance Actions
dane_discovery-0.22.tar.gz 21.2 kB Without provenance Details for dane_discovery-0.22.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dane-discovery 0.22
File Interpreter ABI Platform Actions
dane_discovery-0.22-py3-none-any.whl Python 3 none any Details for dane_discovery-0.22-py3-none-any.whl

Total release size: 42.6 kB

Release files / dane_discovery-0.22.tar.gz

Download URL dane_discovery-0.22.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
be98a66611dcf5e0491a5e4353fbd79c6680413a65d2cf230e521cb79264e926
BLAKE2b-256 checksum
How to use checksums
bd3557ff7d68644188c3a11c43306b43aa7552fe8e4496f5f2b8667561d462cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release files / dane_discovery-0.22-py3-none-any.whl

Download URL dane_discovery-0.22-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff23cd0399293b540d7876a0bd540924d327427b5e75e246ec4ae6a6befc569a
BLAKE2b-256 checksum
How to use checksums
bcdd475657d40ec1b70590dac76dfe9974ada30f473d8ba667a87f816fd1764f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Security for dane-discovery 0.22

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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