summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/cli
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-06-15 11:27:32 +0200
committerRuben Pollan <meskio@sindominio.net>2017-06-15 11:27:32 +0200
commitfe67a55d8744aede22f69b53b5ce0b983a3f4823 (patch)
tree6e677cda78795f157aabed3ec40d85e92d7525dd /src/leap/bitmask/cli
parent69e4fb92bad4bb593d59cfe29eb51d238e0fd8db (diff)
[feat] Add a 'fetch' flag to key export
If is set keyamanger will try to discover and download the key. - Resolves: #8821
Diffstat (limited to 'src/leap/bitmask/cli')
-rw-r--r--src/leap/bitmask/cli/keys.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/leap/bitmask/cli/keys.py b/src/leap/bitmask/cli/keys.py
index 0412efe3..12191a5d 100644
--- a/src/leap/bitmask/cli/keys.py
+++ b/src/leap/bitmask/cli/keys.py
@@ -70,6 +70,9 @@ SUBCOMMANDS:
help='Select the userid of the keyring')
parser.add_argument('--private', action='store_true',
help='Use private keys (by default uses public)')
+ parser.add_argument('--fetch', action='store_true',
+ help='Try to fetch remotely the key if it is not '
+ 'in the local storage')
parser.add_argument('address', nargs=1,
help='email address of the key')
subargs = parser.parse_args(raw_args)
@@ -78,10 +81,14 @@ SUBCOMMANDS:
if not userid:
userid = self.cfg.get('bonafide', 'active', default='')
self.data += ['export', userid, subargs.address[0]]
+
+ if subargs.private and subargs.fetch:
+ print('Cannot fetch private keys')
+ return
if subargs.private:
self.data += ['private']
- else:
- self.data += ['public']
+ if subargs.fetch:
+ self.data += ['fetch']
return self._send(self._print_key)