keys-on-cli
quadrismegistus 4 years ago
parent f7646d2011
commit 870400b409

@ -300,9 +300,7 @@ Keymaker ({self}) is forging new keys for {name}
# gen encrypted keys! # gen encrypted keys!
keychain = self.gen_encr_keys(keychain,keys_to_gen,passphrase=passphrase) keychain = self.gen_encr_keys(keychain,keys_to_gen,passphrase=passphrase)
self.log('I built this keychain!',dict_format(keychain,tab=2)) self.log('I built this keychain!',dict_format(keychain,tab=2))
# b64ize?
for k,v in keychain.items(): keychain[k]=b64encode(v)
# save keys! # save keys!
# get URI id to save under (except for pubkeys, accessible by name) # get URI id to save under (except for pubkeys, accessible by name)

@ -33,6 +33,11 @@ def do_pause():
def dict_format(d, tab=0): def dict_format(d, tab=0):
def repr(v):
if type(v)==bytes and not isBase64(v):
return b64encode(v)
return v
s = ['{\n'] s = ['{\n']
for k,v in sorted(d.items()): for k,v in sorted(d.items()):
if isinstance(v, dict): if isinstance(v, dict):
@ -41,7 +46,7 @@ def dict_format(d, tab=0):
v = repr(v) v = repr(v)
# s.append('%s%r: %s (%s),\n' % (' '*tab, k, v, type(v).__name__)) # s.append('%s%r: %s (%s),\n' % (' '*tab, k, v, type(v).__name__))
s.append('%s%r: %s,\n\n' % (' '*tab, k, v)) s.append('%s%r: %s,\n\n' % (' '*tab, k, repr(v)))
s.append('%s}' % (' '*tab)) s.append('%s}' % (' '*tab))
return ''.join(s) return ''.join(s)

Loading…
Cancel
Save