diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/x509.py | 3 | ||||
-rw-r--r-- | src/cryptography/x509.py | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/x509.py b/src/cryptography/hazmat/backends/openssl/x509.py index 399e6a6e..d78c60fa 100644 --- a/src/cryptography/hazmat/backends/openssl/x509.py +++ b/src/cryptography/hazmat/backends/openssl/x509.py @@ -724,6 +724,9 @@ class _CertificateSigningRequest(object): def __ne__(self, other): return not self == other + def __hash__(self): + return hash(self.public_bytes(serialization.Encoding.DER)) + def public_key(self): pkey = self._backend._lib.X509_REQ_get_pubkey(self._x509_req) assert pkey != self._backend._ffi.NULL diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index d9d6db4a..33c64168 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -1444,6 +1444,12 @@ class CertificateSigningRequest(object): """ @abc.abstractmethod + def __hash__(self): + """ + Computes a hash. + """ + + @abc.abstractmethod def public_key(self): """ Returns the public key |