summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/cli
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-10-24 11:53:10 +0200
committerRuben Pollan <meskio@sindominio.net>2017-10-26 18:37:05 +0200
commit5243c7eb4c58a4419da2103af8c1e4004f01053b (patch)
treeb12fcb016fc95ed9a07a5a2501329db8ec2a623d /src/leap/bitmask/cli
parentd16b25da0962156601615587a612b57b918b0dc6 (diff)
[feat] add fetch key by fingerprint to keymanager
- Resolves: #9023
Diffstat (limited to 'src/leap/bitmask/cli')
-rw-r--r--src/leap/bitmask/cli/keys.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/leap/bitmask/cli/keys.py b/src/leap/bitmask/cli/keys.py
index 82de3868..ab73bfff 100644
--- a/src/leap/bitmask/cli/keys.py
+++ b/src/leap/bitmask/cli/keys.py
@@ -41,6 +41,7 @@ SUBCOMMANDS:
list List all known keys
export Export a given key
+ fetch Fetch key by fingerprint
insert Insert a key to the key storage
delete Delete a key from the key storage
'''.format(name=command.appname)
@@ -97,6 +98,26 @@ SUBCOMMANDS:
return self._send(self._print_key)
+ def fetch(self, raw_args):
+ parser = argparse.ArgumentParser(
+ description='Bitmask fetch key by fingerprint',
+ prog='%s %s %s' % tuple(sys.argv[:3]))
+ parser.add_argument('-u', '--userid', default='',
+ help='Select the userid of the keyring')
+ parser.add_argument('address', nargs=1,
+ help='email address to pin to the key')
+ parser.add_argument('fingerprint', nargs=1,
+ help='fingerprint to fetch of the key')
+ subargs = parser.parse_args(raw_args)
+
+ userid = subargs.userid
+ if not userid:
+ userid = self.cfg.get('bonafide', 'active', default='')
+ self.data += ['fetch', userid, subargs.address[0],
+ subargs.fingerprint[0]]
+
+ return self._send(self._print_key)
+
def insert(self, raw_args):
parser = argparse.ArgumentParser(
description='Bitmask import key',