aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-05-29 07:37:01 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-05-29 07:37:01 -0400
commit13dcdf8ca1f9eba71fc2bcbcf2850cd08db5cdbb (patch)
treec6411f762c8b8c18e3ede3a178a1d55aa32236a2 /src
parentda5a321e0d4266f81ff89d2c7f7b233ad6a6bd41 (diff)
parent16fae766a47f84cab9dd153b92c249a40b27723e (diff)
downloadcryptography-13dcdf8ca1f9eba71fc2bcbcf2850cd08db5cdbb.tar.gz
cryptography-13dcdf8ca1f9eba71fc2bcbcf2850cd08db5cdbb.tar.bz2
cryptography-13dcdf8ca1f9eba71fc2bcbcf2850cd08db5cdbb.zip
Merge pull request #1954 from reaperhulk/inhibitanypolicy
InhibitAnyPolicy class
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/x509.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index 0aeafa74..6592684b 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -791,6 +791,31 @@ class ReasonFlags(Enum):
remove_from_crl = "removeFromCRL"
+class InhibitAnyPolicy(object):
+ def __init__(self, skip_certs):
+ if not isinstance(skip_certs, six.integer_types):
+ raise TypeError("skip_certs must be an integer")
+
+ if skip_certs < 0:
+ raise ValueError("skip_certs must be a non-negative integer")
+
+ self._skip_certs = skip_certs
+
+ def __repr__(self):
+ return "<InhibitAnyPolicy(skip_certs={0.skip_certs})>".format(self)
+
+ def __eq__(self, other):
+ if not isinstance(other, InhibitAnyPolicy):
+ return NotImplemented
+
+ return self.skip_certs == other.skip_certs
+
+ def __ne__(self, other):
+ return not self == other
+
+ skip_certs = utils.read_only_property("_skip_certs")
+
+
@six.add_metaclass(abc.ABCMeta)
class GeneralName(object):
@abc.abstractproperty
@@ -1122,6 +1147,7 @@ OID_OCSP = ObjectIdentifier("1.3.6.1.5.5.7.48.1")
OID_CPS_QUALIFIER = ObjectIdentifier("1.3.6.1.5.5.7.2.1")
OID_CPS_USER_NOTICE = ObjectIdentifier("1.3.6.1.5.5.7.2.2")
+OID_ANY_POLICY = ObjectIdentifier("2.5.29.32.0")
@six.add_metaclass(abc.ABCMeta)