aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-03 10:04:57 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-12 09:13:12 -0500
commit2ca2eb3cfd2dff414fdf200bd53f5c82f3b6bc9d (patch)
tree182926594420831326888e28ecf889c208a5be83 /src
parentcb599d3be59d05ef102759d02069c50466db869c (diff)
downloadcryptography-2ca2eb3cfd2dff414fdf200bd53f5c82f3b6bc9d.tar.gz
cryptography-2ca2eb3cfd2dff414fdf200bd53f5c82f3b6bc9d.tar.bz2
cryptography-2ca2eb3cfd2dff414fdf200bd53f5c82f3b6bc9d.zip
add eq/ne methods for AuthorityKeyIdentifier
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/x509.py14
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(