From 10e8216079e6965eddac4bf293c3049a8b76b5d7 Mon Sep 17 00:00:00 2001 From: jelaiw <14236583+jelaiw@users.noreply.github.com> Date: Tue, 26 Dec 2023 12:03:37 -0600 Subject: [PATCH] Update PSS verify signature code example. --- Doc/src/signature/pkcs1_pss.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/src/signature/pkcs1_pss.rst b/Doc/src/signature/pkcs1_pss.rst index e67484b3..8ca5e9bc 100644 --- a/Doc/src/signature/pkcs1_pss.rst +++ b/Doc/src/signature/pkcs1_pss.rst @@ -21,14 +21,14 @@ The following example shows how the sender can use its own *private* key At the receiver side, the matching *public* RSA key is used to verify authenticity of the incoming message:: - >>> key = RSA.import_key(open('pubkey.der').read()) + >>> key = RSA.import_key(open('pubkey.der', 'rb').read()) >>> h = SHA256.new(message) >>> verifier = pss.new(key) >>> try: >>> verifier.verify(h, signature) - >>> print "The signature is authentic." - >>> except (ValueError, TypeError): - >>> print "The signature is not authentic." + >>> print("The signature is authentic.") + >>> except (ValueError): + >>> print("The signature is not authentic.") .. __: https://tools.ietf.org/html/rfc8017#section-8.1