diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/usage.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/usage.rst b/doc/usage.rst index b4f8426..6ac9e82 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -203,6 +203,15 @@ This hashes the message using SHA-1. Other hash methods are also possible, check the :py:func:`rsa.sign` function documentation for details. The hash is then signed with the private key. +It is possible to calculate the hash and signature in separate operations +(i.e for generating the hash on a client machine and then sign with a +private key on remote server). To hash a message use the :py:func:`rsa.compute_hash` +function and then use the :py:func:`rsa.sign_hash` function to sign the hash: + + >>> message = 'Go left at the blue tree' + >>> hash = rsa.compute_hash(message, 'SHA-1') + >>> 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: |