diff options
Diffstat (limited to 'src/cryptography')
-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 68104e69..a4013389 100644 --- a/src/cryptography/hazmat/backends/openssl/x509.py +++ b/src/cryptography/hazmat/backends/openssl/x509.py @@ -709,6 +709,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 f8134958..0ad1d4f9 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -1410,6 +1410,12 @@ class CertificateSigningRequest(object): """ @abc.abstractmethod + def __hash__(self): + """ + Computes a hash. + """ + + @abc.abstractmethod def public_key(self): """ Returns the public key |