From 3a69b13c38002bc319c5f73df183b8bb558c442a Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 13 May 2015 10:03:46 -0500 Subject: add eq/ne support to BasicConstraints --- src/cryptography/x509.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index b0a4a352..89b9162b 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -333,6 +333,15 @@ class BasicConstraints(object): return ("").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, -- cgit v1.2.3