Skip to content

Commit 2be27b4

Browse files
committed
update documentation to use new equality checks
1 parent f842d60 commit 2be27b4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/hazmat/primitives/asymmetric/cloudhsm.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ if you only need a subset of functionality.
8888
... Maps the cryptography padding and algorithm to the corresponding KMS signing algorithm.
8989
... This is specific to your implementation.
9090
... """
91-
... if isinstance(padding, PKCS1v15) and isinstance(algorithm, hashes.SHA256):
91+
... if padding == PKCS1v15() and algorithm == hashes.SHA256():
9292
... return b"RSA_PKCS1_V1_5_SHA_256"
9393
... else:
9494
... raise NotImplementedError()

docs/x509/reference.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Loading Certificate Revocation Lists
248248
>>> from cryptography import x509
249249
>>> from cryptography.hazmat.primitives import hashes
250250
>>> crl = x509.load_pem_x509_crl(pem_crl_data)
251-
>>> isinstance(crl.signature_hash_algorithm, hashes.SHA256)
251+
>>> crl.signature_hash_algorithm == hashes.SHA256()
252252
True
253253

254254
.. function:: load_der_x509_crl(data)
@@ -287,7 +287,7 @@ Loading Certificate Signing Requests
287287
>>> from cryptography import x509
288288
>>> from cryptography.hazmat.primitives import hashes
289289
>>> csr = x509.load_pem_x509_csr(pem_req_data)
290-
>>> isinstance(csr.signature_hash_algorithm, hashes.SHA256)
290+
>>> csr.signature_hash_algorithm == hashes.SHA256()
291291
True
292292

293293
.. function:: load_der_x509_csr(data)
@@ -477,7 +477,7 @@ X.509 Certificate Object
477477
.. doctest::
478478

479479
>>> from cryptography.hazmat.primitives import hashes
480-
>>> isinstance(cert.signature_hash_algorithm, hashes.SHA256)
480+
>>> cert.signature_hash_algorithm == hashes.SHA256()
481481
True
482482

483483
.. attribute:: signature_algorithm_oid
@@ -716,7 +716,7 @@ X.509 CRL (Certificate Revocation List) Object
716716
.. doctest::
717717

718718
>>> from cryptography.hazmat.primitives import hashes
719-
>>> isinstance(crl.signature_hash_algorithm, hashes.SHA256)
719+
>>> crl.signature_hash_algorithm == hashes.SHA256()
720720
True
721721

722722
.. attribute:: signature_algorithm_oid
@@ -1119,7 +1119,7 @@ X.509 CSR (Certificate Signing Request) Object
11191119
.. doctest::
11201120

11211121
>>> from cryptography.hazmat.primitives import hashes
1122-
>>> isinstance(csr.signature_hash_algorithm, hashes.SHA256)
1122+
>>> csr.signature_hash_algorithm == hashes.SHA256()
11231123
True
11241124

11251125
.. attribute:: signature_algorithm_oid

0 commit comments

Comments
 (0)