From f290e4e2a2a8d7fdd5d42fe0d7faba051e7b123c Mon Sep 17 00:00:00 2001 From: Richard Vodden Date: Fri, 19 Feb 2021 08:11:53 +0000 Subject: Correct return value of verify() --- doc/usage.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc') 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: -- cgit v1.2.1