aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-13 10:00:41 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-13 10:00:41 -0500
commit58cc3973cf3c3e83d5cb9e1d29e1a4fd9b88eff7 (patch)
tree40ff2be75b7d52054f4df4f19d1f8f9ef43b3199 /src
parent91ea3a91fe67ecf2577b3f88955c4baad4d4f131 (diff)
downloadcryptography-58cc3973cf3c3e83d5cb9e1d29e1a4fd9b88eff7.tar.gz
cryptography-58cc3973cf3c3e83d5cb9e1d29e1a4fd9b88eff7.tar.bz2
cryptography-58cc3973cf3c3e83d5cb9e1d29e1a4fd9b88eff7.zip
add eq/ne support to SubjectAlternativeName
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 b0a4a352..8e9c1aca 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -914,6 +914,15 @@ class SubjectAlternativeName(object):
def __repr__(self):
return "<SubjectAlternativeName({0})>".format(self._general_names)
+ def __eq__(self, other):
+ if not isinstance(other, SubjectAlternativeName):
+ return NotImplemented
+
+ return self._general_names == other._general_names
+
+ def __ne__(self, other):
+ return not self == other
+
class AuthorityKeyIdentifier(object):
def __init__(self, key_identifier, authority_cert_issuer,