summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/cli/keys.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/cli/keys.py')
-rw-r--r--src/leap/bitmask/cli/keys.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/leap/bitmask/cli/keys.py b/src/leap/bitmask/cli/keys.py
index 65747cb..b11d280 100644
--- a/src/leap/bitmask/cli/keys.py
+++ b/src/leap/bitmask/cli/keys.py
@@ -50,7 +50,11 @@ SUBCOMMANDS:
help='Use private keys (by default uses public)')
subargs = parser.parse_args(raw_args)
- self.data += ['list', subargs.uid]
+ userid = subargs.userid
+ if not userid:
+ userid = self.cfg.get('bonafide', 'active', default='')
+
+ self.data += ['list', userid]
if subargs.private:
self.data += ['private']
else:
@@ -69,7 +73,11 @@ SUBCOMMANDS:
parser.add_argument('address', nargs=1,
help='email address of the key')
subargs = parser.parse_args(raw_args)
- self.data += ['export', subargs.uid, subargs.address[0]]
+
+ userid = subargs.userid
+ if not userid:
+ userid = self.cfg.get('bonafide', 'active', default='')
+ self.data += ['export', userid, subargs.address[0]]
return self._send(self._print_key)
@@ -88,9 +96,13 @@ SUBCOMMANDS:
help='email address of the key')
subargs = parser.parse_args(raw_args)
+ userid = subargs.userid
+ if not userid:
+ userid = self.cfg.get('bonafide', 'active')
+
with open(subargs.file[0], 'r') as keyfile:
rawkey = keyfile.read()
- self.data += ['insert', subargs.uid, subargs.address[0],
+ self.data += ['insert', userid, subargs.address[0],
subargs.validation, rawkey]
return self._send(self._print_key)
@@ -106,8 +118,12 @@ SUBCOMMANDS:
parser.add_argument('address', nargs=1,
help='email address of the key')
subargs = parser.parse_args(raw_args)
- self.data += ['delete', subargs.uid, subargs.address[0]]
+ userid = subargs.userid
+ if not userid:
+ userid = self.cfg.get('bonafide', 'active')
+
+ self.data += ['delete', userid, subargs.address[0]]
return self._send()
def _print_key_list(self, keys):