1 parent 4ec4b85 commit 10e8216Copy full SHA for 10e8216
1 file changed
Doc/src/signature/pkcs1_pss.rst
@@ -21,14 +21,14 @@ The following example shows how the sender can use its own *private* key
21
At the receiver side, the matching *public* RSA key is used to verify
22
authenticity of the incoming message::
23
24
- >>> key = RSA.import_key(open('pubkey.der').read())
+ >>> key = RSA.import_key(open('pubkey.der', 'rb').read())
25
>>> h = SHA256.new(message)
26
>>> verifier = pss.new(key)
27
>>> try:
28
>>> verifier.verify(h, signature)
29
- >>> print "The signature is authentic."
30
- >>> except (ValueError, TypeError):
31
- >>> print "The signature is not authentic."
+ >>> print("The signature is authentic.")
+ >>> except (ValueError):
+ >>> print("The signature is not authentic.")
32
33
.. __: https://tools.ietf.org/html/rfc8017#section-8.1
34
0 commit comments