Skip to content

Commit 10e8216

Browse files
jelaiwLegrandin
authored andcommitted
Update PSS verify signature code example.
1 parent 4ec4b85 commit 10e8216

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/src/signature/pkcs1_pss.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ The following example shows how the sender can use its own *private* key
2121
At the receiver side, the matching *public* RSA key is used to verify
2222
authenticity of the incoming message::
2323

24-
>>> key = RSA.import_key(open('pubkey.der').read())
24+
>>> key = RSA.import_key(open('pubkey.der', 'rb').read())
2525
>>> h = SHA256.new(message)
2626
>>> verifier = pss.new(key)
2727
>>> try:
2828
>>> verifier.verify(h, signature)
29-
>>> print "The signature is authentic."
30-
>>> except (ValueError, TypeError):
31-
>>> print "The signature is not authentic."
29+
>>> print("The signature is authentic.")
30+
>>> except (ValueError):
31+
>>> print("The signature is not authentic.")
3232

3333
.. __: https://tools.ietf.org/html/rfc8017#section-8.1
3434

0 commit comments

Comments
 (0)