From fe67a55d8744aede22f69b53b5ce0b983a3f4823 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Thu, 15 Jun 2017 11:27:32 +0200 Subject: [feat] Add a 'fetch' flag to key export If is set keyamanger will try to discover and download the key. - Resolves: #8821 --- src/leap/bitmask/cli/keys.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask/cli') 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) -- cgit v1.2.3