diff options
author | Ben McGinnes <[email protected]> | 2018-03-15 00:18:02 +0000 |
---|---|---|
committer | Ben McGinnes <[email protected]> | 2018-03-15 00:18:02 +0000 |
commit | b35aaef7a3b793b8f6f5b42596c0a6a51e87f78c (patch) | |
tree | 56c6287d08c1783bdade703236d27f9ac6c9e2e0 /lang/python/docs/GPGMEpythonHOWTOen.org | |
parent | doc: python bindings howto (diff) | |
download | gpgme-b35aaef7a3b793b8f6f5b42596c0a6a51e87f78c.tar.gz gpgme-b35aaef7a3b793b8f6f5b42596c0a6a51e87f78c.zip |
doc: python bindings howto
* Added text for verifying signatures.
Diffstat (limited to '')
-rw-r--r-- | lang/python/docs/GPGMEpythonHOWTOen.org | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lang/python/docs/GPGMEpythonHOWTOen.org b/lang/python/docs/GPGMEpythonHOWTOen.org index 7e7265ff..dca69993 100644 --- a/lang/python/docs/GPGMEpythonHOWTOen.org +++ b/lang/python/docs/GPGMEpythonHOWTOen.org @@ -936,6 +936,27 @@ pass #+end_src + In both of the previous examples it is also possible to compare the + original data that was signed against the signed data in + =verified[0]= to see if it matches with something like this: + + #+begin_src python + afile = open(filename, "rb") + text = afile.read() + afile.close() + + if text == verified[0]: + print("Good signature.") + else: + pass + #+end_src + + The following two examples, however, deal with detached signatures. + With his method of verification the data that was signed does not + get returned since it is already being explicitly referenced in the + first argument of =c.verify=. So =verified[0]= is None and only + the data in =verified[1]= is available. + #+begin_src python import gpg import time |