add __hash__ to PolicyConstraints and Extension (#3917)

diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py
index f6957b9..0bfe6f9 100644
--- a/src/cryptography/x509/extensions.py
+++ b/src/cryptography/x509/extensions.py
@@ -554,6 +554,11 @@
     def __ne__(self, other):
         return not self == other
 
+    def __hash__(self):
+        return hash(
+            (self.require_explicit_policy, self.inhibit_policy_mapping)
+        )
+
     require_explicit_policy = utils.read_only_property(
         "_require_explicit_policy"
     )
@@ -1063,6 +1068,9 @@
     def __ne__(self, other):
         return not self == other
 
+    def __hash__(self):
+        return hash((self.oid, self.critical, self.value))
+
 
 class GeneralNames(object):
     def __init__(self, general_names):