diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-05-12 11:22:30 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-05-12 11:22:30 -0400 |
commit | cdcd45f0ad8eda3b940ba051555c4465c8b777db (patch) | |
tree | 91a4973eaa5765aad7d6b63e08be3a05424bfa92 /src | |
parent | 94d78f457a4f58596d597e543ef8a90e1c764c1d (diff) | |
parent | 2ca2eb3cfd2dff414fdf200bd53f5c82f3b6bc9d (diff) | |
download | cryptography-cdcd45f0ad8eda3b940ba051555c4465c8b777db.tar.gz cryptography-cdcd45f0ad8eda3b940ba051555c4465c8b777db.tar.bz2 cryptography-cdcd45f0ad8eda3b940ba051555c4465c8b777db.zip |
Merge pull request #1931 from reaperhulk/aki-eq
add eq/ne methods for AuthorityKeyIdentifier
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/x509.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index cdddfb57..173fd084 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -950,6 +950,20 @@ class AuthorityKeyIdentifier(object): ")>".format(self) ) + def __eq__(self, other): + if not isinstance(other, AuthorityKeyIdentifier): + return NotImplemented + + return ( + self.key_identifier == other.key_identifier and + self.authority_cert_issuer == other.authority_cert_issuer and + self.authority_cert_serial_number == + other.authority_cert_serial_number + ) + + def __ne__(self, other): + return not self == other + key_identifier = utils.read_only_property("_key_identifier") authority_cert_issuer = utils.read_only_property("_authority_cert_issuer") authority_cert_serial_number = utils.read_only_property( |