aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-05-13 13:43:23 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-05-13 13:43:23 -0400
commit6caa5bbecad4479593bdaf7d8775d5af4e1717b4 (patch)
tree1e2c66a4f71308ab70a51daaaac86c26e1c4b27c /src
parent3325b0e9d525ec9861b5eba57e14fe9548e6dcde (diff)
parent3a69b13c38002bc319c5f73df183b8bb558c442a (diff)
downloadcryptography-6caa5bbecad4479593bdaf7d8775d5af4e1717b4.tar.gz
cryptography-6caa5bbecad4479593bdaf7d8775d5af4e1717b4.tar.bz2
cryptography-6caa5bbecad4479593bdaf7d8775d5af4e1717b4.zip
Merge pull request #1944 from reaperhulk/bc-eq
add eq/ne support to BasicConstraints
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/x509.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index 2b7ec317..71ba9042 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -333,6 +333,15 @@ class BasicConstraints(object):
return ("<BasicConstraints(ca={0.ca}, "
"path_length={0.path_length})>").format(self)
+ def __eq__(self, other):
+ if not isinstance(other, BasicConstraints):
+ return NotImplemented
+
+ return self.ca == other.ca and self.path_length == other.path_length
+
+ def __ne__(self, other):
+ return not self == other
+
class KeyUsage(object):
def __init__(self, digital_signature, content_commitment, key_encipherment,