summaryrefslogtreecommitdiff
path: root/util.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2012-12-24 12:46:37 -0200
committerdrebs <drebs@leap.se>2012-12-24 12:46:37 -0200
commitf47ae5cef2cbf5b0654b158ed02a621e9c9d1127 (patch)
tree79f21fccd67b1c25cab9772c1a5cd25c71501ed6 /util.py
parent31c7f424e54c75847581a786b6a749bba5fb5e7a (diff)
Add send_keys to GPGWrapper
Diffstat (limited to 'util.py')
-rw-r--r--util.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/util.py b/util.py
index 5d1e263e..af38cd76 100644
--- a/util.py
+++ b/util.py
@@ -38,6 +38,20 @@ class GPGWrapper(gnupg.GPG):
always_trust=always_trust,
passphrase=passphrase)
+ def send_keys(self, keyserver, *keyids):
+ """
+ Send keys to a keyserver
+ """
+ result = self.result_map['list'](self)
+ logger.debug('send_keys: %r', keyids)
+ data = _make_binary_stream("", self.encoding)
+ args = ['--keyserver', keyserver, '--send-keys']
+ args.extend(keyids)
+ self._handle_io(args, data, result, binary=True)
+ logger.debug('send_keys result: %r', result.__dict__)
+ data.close()
+ return result
+
#----------------------------------------------------------------------------
# u1db Transaction and Sync logs.