diff options
author | Richard Vodden <richard@vodden.com> | 2021-02-19 08:11:53 +0000 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2021-02-24 13:28:12 +0100 |
commit | f290e4e2a2a8d7fdd5d42fe0d7faba051e7b123c (patch) | |
tree | 3b725a2dc444d8c1948465cb076268a46bd6ca42 | |
parent | 3450f43c6d6766012b854d751da4475e49f19850 (diff) | |
download | rsa-git-f290e4e2a2a8d7fdd5d42fe0d7faba051e7b123c.tar.gz |
Correct return value of verify()
-rw-r--r-- | doc/usage.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/usage.rst b/doc/usage.rst index f76765e..9e18a1b 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -187,11 +187,12 @@ function and then use the :py:func:`rsa.sign_hash` function to sign the hash: >>> signature = rsa.sign_hash(hash, privkey, 'SHA-1') In order to verify the signature, use the :py:func:`rsa.verify` -function. This function returns True if the verification is successful: +function. This function returns the name of the hash used. If the verification +is no successful a >>> message = 'Go left at the blue tree'.encode() >>> rsa.verify(message, signature, pubkey) - True + 'SHA-1' Modify the message, and the signature is no longer valid and a :py:class:`rsa.pkcs1.VerificationError` is thrown: |