Debian Codegraph @

dns/dnssectypes.py

raw
1 # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
2
3 # Copyright (C) 2003-2017 Nominum, Inc.
4 #
5 # Permission to use, copy, modify, and distribute this software and its
6 # documentation for any purpose with or without fee is hereby granted,
7 # provided that the above copyright notice and this permission notice
8 # appear in all copies.
9 #
10 # THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
16 # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
18 """Common DNSSEC-related types."""
19
20 # This is a separate file to avoid import circularity between dns.dnssec and
21 # the implementations of the DS and DNSKEY types.
22
23 import dns.enum
24
25
26 class Algorithm(dns.enum.IntEnum):
27 RSAMD5 = 1
28 DH = 2
29 DSA = 3
30 ECC = 4
31 RSASHA1 = 5
32 DSANSEC3SHA1 = 6
33 RSASHA1NSEC3SHA1 = 7
34 RSASHA256 = 8
35 RSASHA512 = 10
36 ECCGOST = 12
37 ECDSAP256SHA256 = 13
38 ECDSAP384SHA384 = 14
39 ED25519 = 15
40 ED448 = 16
41 INDIRECT = 252
42 PRIVATEDNS = 253
43 PRIVATEOID = 254
44
45 @classmethod
46 def _maximum(cls):
47 return 255
48
49
50 class DSDigest(dns.enum.IntEnum):
51 """DNSSEC Delegation Signer Digest Algorithm"""
52
53 NULL = 0
54 SHA1 = 1
55 SHA256 = 2
56 GOST = 3
57 SHA384 = 4
58
59 @classmethod
60 def _maximum(cls):
61 return 255
62
63
64 class NSEC3Hash(dns.enum.IntEnum):
65 """NSEC3 hash algorithm"""
66
67 SHA1 = 1
68
69 @classmethod
70 def _maximum(cls):
71 return 255