aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/x509/extensions.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py
index 9d6b3e79..f6957b9d 100644
--- a/src/cryptography/x509/extensions.py
+++ b/src/cryptography/x509/extensions.py
@@ -755,6 +755,9 @@ class ExtendedKeyUsage(object):
def __ne__(self, other):
return not self == other
+ def __hash__(self):
+ return hash(tuple(self._usages))
+
@utils.register_interface(ExtensionType)
class OCSPNoCheck(object):
@@ -933,6 +936,15 @@ class KeyUsage(object):
def __ne__(self, other):
return not self == other
+ def __hash__(self):
+ return hash((
+ self.digital_signature, self.content_commitment,
+ self.key_encipherment, self.data_encipherment,
+ self.key_agreement, self.key_cert_sign,
+ self.crl_sign, self._encipher_only,
+ self._decipher_only
+ ))
+
@utils.register_interface(ExtensionType)
class NameConstraints(object):