Skip to content

Commit 5cc4ab6

Browse files
committed
Update documentation for NoDigestInfo
1 parent 7147c86 commit 5cc4ab6

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

docs/hazmat/primitives/asymmetric/rsa.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,9 +784,10 @@ Key interfaces
784784
``algorithm`` parameters must match the ones used when the signature
785785
was created for the recovery to succeed.
786786

787-
The ``algorithm`` parameter can also be set to ``None`` to recover all
787+
The ``algorithm`` parameter can also be set to ``NoDigestInfo`` to recover all
788788
the data present in the signature, without regard to its format or the
789-
hash algorithm used for its creation.
789+
hash algorithm used for its creation. (Note that setting ``algorithm`` to ``None`
790+
is deprecated and have the same semantic as setting ``NoDigestInfo``.)
790791

791792
For
792793
:class:`~cryptography.hazmat.primitives.asymmetric.padding.PKCS1v15`

docs/hazmat/primitives/asymmetric/utils.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ Asymmetric Utilities
2929

3030
:return bytes: The encoded signature.
3131

32+
.. class:: NoDigestInfo()
33+
34+
.. versionadded:: 47.0
35+
36+
Use a non-standard RSA signature formats where the PKCS #1-padded data is without DigestInfo.
37+
38+
``NoDigestInfo`` can be passed as the ``algorithm`` in the RSA
39+
:meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey.sign`,
40+
:meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey.verify`
41+
and
42+
:meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey.recover_data_from_signature`
43+
methods.
44+
3245
.. class:: Prehashed(algorithm)
3346

3447
.. versionadded:: 1.6

0 commit comments

Comments
 (0)