summaryrefslogtreecommitdiff
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
commit948f12a655435968f2754209f8031516433255f4 (patch)
treefce87c60e0c1a4bd6af6174b3f804cba18d2b35a
parent34fc48331fb036c723d75acce203be3b988dc5e9 (diff)
Add send_keys to GPGWrapper
-rw-r--r--src/leap/soledad/util.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/leap/soledad/util.py b/src/leap/soledad/util.py
index 5d1e263e..af38cd76 100644
--- a/src/leap/soledad/util.py
+++ b/src/leap/soledad/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.