File: pinset.py

package info (click to toggle)
python-getdns 1.0.0~b1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 448 kB
  • sloc: ansic: 3,538; python: 607; makefile: 130
file content (18 lines) | stat: -rwxr-xr-x 611 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
#
# Note that we expect that each pin in the pinset list
#   must be prefaced with pin-<algorithm>= and the pin 
#   itself must be base64-encoded and enclosed in double-
#   quotes.  We may loosen this up in a future version
#

import getdns
c = getdns.Context()
u = [ { 'address_data': '185.49.141.37', 
        'address_type': 'IPv4', 
        'tls_pubkey_pinset': ['pin-sha256="foxZRnIh9gZpWnl+zEiKa0EJ2rdCGroMWm02gaxSc9S="']
 }]
c.resolution_type = getdns.RESOLUTION_STUB
c.dns_transport_list = [ getdns.TRANSPORT_TLS ]
c.upstream_recursive_servers = u
f = c.address('getdnsapi.net')