An implementation of DNS stamps as described at: https://dnscrypt.info/stamps-specifications
Types
Protocol = enum protoDns = "DNS", protoDnsCrypt = "DNSCrypt", protoDnsOverHttps = "DNS-over-HTTPS", protoDnsOverTls = "DNS-over-TLS", protoDnsCryptRelay = "Anonymized DNSCrypt relay"
-
Protocol of the DNS server.
See also:
- toInt for getting the integer identifier of the protocol.
- intToProtocol for converting an integer to Protocol.
Properties = enum propDnssec = "DNSSEC", propNoLog = "No logs", propNoFilter = "No filter"
- Informal properties of the DNS server. Source Edit
Stamp = object address*: string ## The IP address (and/or port) to the server. props*: set[Properties] ## The set of informal properties of the server case proto*: Protocol ## The protocol of the stamp. of protoDnsCrypt: providerName*: string ## The name of the DNSCrypt provider publicKey*: array[32, byte] ## The Ed25519 public key of the provider of protoDnsOverHttps, protoDnsOverTls: hashes*: seq[array[32, byte]] ## The list of SHA256 digests of the TBS certificates in the ## certification chain. Should not be empty. hostname*, path*: string ## Hostname and path to the resolver. ## Hostname must not be empty. ## Path is ignored for DNS-over-TLS stamps. bootstrapIps*: seq[string] ## The list of regular DNS resolvers recommended for resolving the ## hostname if no IP address is provided. Can be empty. else: nil
- The structured representation of a DNS server stamp. Source Edit
Funcs
func toInt(protocol: Protocol): int {...}{.inline, raises: [], tags: [].}
- Returns the integer identifier of the given protocol. Source Edit
func intToProtocol(i: int): Protocol {...}{.inline, raises: [ValueError], tags: [].}
-
Returns the Protocol corresponding to the given integer i.
Raises ValueError if i is not a valid protocol identifier.
Source Edit func isRelay(protocol: Protocol): bool {...}{.inline, raises: [], tags: [].}
- Returns whether the given protocol is a relay type. Source Edit
func initDnsStamp(address: string; props: set[Properties] = {}): Stamp {...}{.inline, raises: [], tags: [].}
-
Create a DNS server stamp.
Source Editaddress: The IP address of the resolver, must not be empty. props: The set of informal Properties of the resolver. func initDnsCryptStamp(address: string; publicKey: openArray[byte]; providerName: string; props: set[Properties] = {}): Stamp {...}{. inline, raises: [], tags: [].}
-
Create a DNSCrypt server stamp.
Source Editaddress: The IP address of the resolver with an optional port number if not reachable via the standard port (443), must not be empty. publicKey: The provider's Ed25519 public key in bytes. The array must be exactly 32 bytes in size. providerName: The name of the provider, must not be empty. props: The set of informal Properties of the resolver. func initDoHStamp(address: string = ""; hashes: openArray[array[32, byte]]; hostname: string; path = "/dns-query"; bootstrapIps: openArray[string] = []; props: set[Properties] = {}): Stamp {...}{.inline, raises: [], tags: [].}
-
Create a DNS-over-HTTPS server stamp.
Source Editaddress: The IP address of the resolver. Can be empty or just a port number represented with a preceding colon (eg. :443). hashes: List of SHA256 digests of the TBS certificates found in the verification chain, typically the certificates used to sign the resolver's certificate. At least one hash must be present. hostname: The server host name, must not be empty. path: The absolute URI path to the resolver (eg. /dns-query). bootstrapIps: The list of IP addresses of recommended resolvers accessible over standard DNS in order to resolve hostname. props: The set of informal Properties of the resolver. func initDoTStamp(address: string; hashes: openArray[array[32, byte]]; hostname: string; bootstrapIps: openArray[string] = []; props: set[Properties] = {}): Stamp {...}{.inline, raises: [], tags: [].}
-
Create a DNS-over-TLS server stamp.
Source Editaddress: The IP address of the resolver. Can be empty or just a port number represented with a preceding colon (eg. :853). hashes: List of SHA256 digests of the TBS certificates found in the verification chain, typically the certificates used to sign the resolver's certificate. At least one hash must be present. hostname: The server host name, must not be empty. bootstrapIps: The list of IP addresses of recommended resolvers accessible over standard DNS in order to resolve hostname. props: The set of informal Properties of the resolver. func initDnsCryptRelayStamp(address: string): Stamp {...}{.inline, raises: [], tags: [].}
-
Create an Anonymized DNSCrypt relay stamp.
Source Editaddress: The IP address of the relay, must not be empty.