aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/x509
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptography/x509')
-rw-r--r--src/cryptography/x509/extensions.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py
index 44d5be94..01378b38 100644
--- a/src/cryptography/x509/extensions.py
+++ b/src/cryptography/x509/extensions.py
@@ -973,6 +973,19 @@ class NameConstraints(object):
u"excluded_subtrees={0.excluded_subtrees})>".format(self)
)
+ def __hash__(self):
+ if self.permitted_subtrees is not None:
+ ps = tuple(self.permitted_subtrees)
+ else:
+ ps = None
+
+ if self.excluded_subtrees is not None:
+ es = tuple(self.excluded_subtrees)
+ else:
+ es = None
+
+ return hash((ps, es))
+
permitted_subtrees = utils.read_only_property("_permitted_subtrees")
excluded_subtrees = utils.read_only_property("_excluded_subtrees")