aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2015-07-28 23:39:47 -0700
committerBrian Dolbec <dolsen@gentoo.org>2015-08-08 08:51:40 -0700
commit24aa5eb9f92883fb0fb3e7222b78eeddf33b9bf6 (patch)
tree4fd663d3c0f1d28f4b754e52c6213f9194e5644f
parentgkeys: [2 of 2] Move common key handling to it's own class (diff)
downloadgentoo-keys-24aa5eb9f92883fb0fb3e7222b78eeddf33b9bf6.tar.gz
gentoo-keys-24aa5eb9f92883fb0fb3e7222b78eeddf33b9bf6.tar.bz2
gentoo-keys-24aa5eb9f92883fb0fb3e7222b78eeddf33b9bf6.zip
gkeys/lib.py: Creation of the code for the verify_text()
-rw-r--r--gkeys/gkeys/lib.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/gkeys/gkeys/lib.py b/gkeys/gkeys/lib.py
index 528464b..5ad1aab 100644
--- a/gkeys/gkeys/lib.py
+++ b/gkeys/gkeys/lib.py
@@ -318,10 +318,19 @@ class GkeysGPG(GPG):
pass
- def verify_text(self, text):
+ def verify_text(self, gkey, text, filepath=None):
'''Verify a text block in memory
+
+ @param gkey: GKEY instance of the gpg key used to verify it
+ @param text: string of the of the text to verify
+ @param filepath: optional string with the path or url of the signed file
'''
- pass
+ self.set_keydir(gkey.keydir, 'verify', fingerprint=False, reset=True)
+ self.logger.debug("** Calling runGPG with Running 'gpg %s --verify %s'"
+ % (' '.join(self.config['tasks']['verify']), filepath))
+ results = self.runGPG(task='verify', inputfile=filepath, inputtxt=text)
+ self._log_result('verification', gkey, results)
+ return results
def verify_file(self, gkey, signature, filepath):