File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,14 @@ The following example shows how the sender can use its own *private* key
21
21
At the receiver side, the matching *public * RSA key is used to verify
22
22
authenticity of the incoming message::
23
23
24
- >>> key = RSA.import_key(open('pubkey.der').read())
24
+ >>> key = RSA.import_key(open('pubkey.der', 'rb' ).read())
25
25
>>> h = SHA256.new(message)
26
26
>>> verifier = pss.new(key)
27
27
>>> try:
28
28
>>> 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.")
32
32
33
33
.. __ : https://tools.ietf.org/html/rfc8017#section-8.1
34
34
You can’t perform that action at this time.
0 commit comments