summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTim Heckman <tim+code@timheckman.net>2012-10-17 21:09:43 -0400
committerTim Heckman <tim+code@timheckman.net>2012-10-17 21:09:43 -0400
commit7446f0a8d0eadac1581d86891fac8b5c554cc13b (patch)
tree0c3311d211dd44e73a177cd424fa27f50cdec73c /doc
parent14ba108859bb118f425b0e35054f3add6f006be2 (diff)
downloadrsa-git-7446f0a8d0eadac1581d86891fac8b5c554cc13b.tar.gz
rsa.pkcs1.verify() should return True when successful
- when verification passes verify() will return True, instead of None. If verification fails the function will still raise a rsa.pkcs1.VerificationError for legacy purposes. - update the docs to note that the verify() function returns True when successful - write unit tests to verify this new behavior This commit passes all build tests: Ran 44 tests in 1.217s OK
Diffstat (limited to 'doc')
-rw-r--r--doc/usage.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/usage.rst b/doc/usage.rst
index 611e868..8a736fb 100644
--- a/doc/usage.rst
+++ b/doc/usage.rst
@@ -197,10 +197,11 @@ possible, check the :py:func:`rsa.sign` function documentation for
details. The hash is then signed with the private key.
In order to verify the signature, use the :py:func:`rsa.verify`
-function.
+function. This function returns True if the verification is successful:
>>> message = 'Go left at the blue tree'
>>> rsa.verify(message, signature, pubkey)
+ True
Modify the message, and the signature is no longer valid and a
:py:class:`rsa.pkcs1.VerificationError` is thrown: