Skip to main content

A library for using DANE for public key discovery.

Project description

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

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

dane_discovery-0.22.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dane_discovery-0.22-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file dane_discovery-0.22.tar.gz.

File metadata

  • Download URL: dane_discovery-0.22.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for dane_discovery-0.22.tar.gz
Algorithm Hash digest
SHA256 be98a66611dcf5e0491a5e4353fbd79c6680413a65d2cf230e521cb79264e926
MD5 fa93eefe20ed08dfb10a96fa7c68ce94
BLAKE2b-256 bd3557ff7d68644188c3a11c43306b43aa7552fe8e4496f5f2b8667561d462cc

See more details on using hashes here.

File details

Details for the file dane_discovery-0.22-py3-none-any.whl.

File metadata

  • Download URL: dane_discovery-0.22-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for dane_discovery-0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 ff23cd0399293b540d7876a0bd540924d327427b5e75e246ec4ae6a6befc569a
MD5 702dbfb6d9c9194a872a63454a6307e9
BLAKE2b-256 bcdd475657d40ec1b70590dac76dfe9974ada30f473d8ba667a87f816fd1764f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page