Updated list command output.

This commit is contained in:
HeshamTB 2020-04-18 17:53:12 +03:00
parent 0d6bf9228d
commit 06793f5fb7
Signed by: Hesham
GPG Key ID: 74876157D199B09E

6
rsa.py
View File

@ -235,14 +235,14 @@ def listKeys():
if len(local_keys) == 0: if len(local_keys) == 0:
print("Cant find local keys.") print("Cant find local keys.")
return return
print("ID PRIVATE") print("ID PRIVATE SIZE")
print("________________") print("-------------------------")
for keyName in local_keys: for keyName in local_keys:
key = readKeyFile(keyName) key = readKeyFile(keyName)
if key[D] == 0: if key[D] == 0:
check = "".strip() check = "".strip()
else: check = '\u2713' else: check = '\u2713'
print("{} {}\n".format(key[ID], check).strip()) print("%7s%7s%7s-bit" % (key[ID].strip(), check, key[N].bit_length()))
def exportKey(keyFileName): def exportKey(keyFileName):
key = readKeyFile(keyFileName) key = readKeyFile(keyFileName)