diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-17 09:15:30 -0700 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-17 09:15:30 -0700 |
commit | 58e870ca8ac61e4099fb9d5d9e10820d338f8671 (patch) | |
tree | 1c7d802851d417a675740bbd2b2492d70463929d /src | |
parent | ad9d46ee7f9a7f74ee9a0345fe1c60fb8c49dcaf (diff) | |
download | cryptography-58e870ca8ac61e4099fb9d5d9e10820d338f8671.tar.gz cryptography-58e870ca8ac61e4099fb9d5d9e10820d338f8671.tar.bz2 cryptography-58e870ca8ac61e4099fb9d5d9e10820d338f8671.zip |
x509 extension equality
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/x509.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index ec2092bb..325d6d62 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -278,6 +278,19 @@ class Extension(object): return ("<Extension(oid={0.oid}, critical={0.critical}, " "value={0.value})>").format(self) + def __eq__(self, other): + if not isinstance(other, Extension): + return NotImplemented + + return ( + self.oid == other.oid and + self.critical == other.critical and + self.value == other.value + ) + + def __ne__(self, other): + return not self == other + class ExtendedKeyUsage(object): def __init__(self, usages): |