diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-13 10:03:46 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-13 10:03:46 -0500 |
commit | 3a69b13c38002bc319c5f73df183b8bb558c442a (patch) | |
tree | 1da78ea5f521d78ea2a25b8d5423ec4d3f06a009 /src | |
parent | 91ea3a91fe67ecf2577b3f88955c4baad4d4f131 (diff) | |
download | cryptography-3a69b13c38002bc319c5f73df183b8bb558c442a.tar.gz cryptography-3a69b13c38002bc319c5f73df183b8bb558c442a.tar.bz2 cryptography-3a69b13c38002bc319c5f73df183b8bb558c442a.zip |
add eq/ne support to BasicConstraints
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/x509.py | 9 |
1 files changed, 9 insertions, 0 deletions
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 ("<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, |