Check number of args in 'gen' command interface

This commit is contained in:
HeshamTB 2020-09-06 06:09:12 +03:00
parent d51a42589c
commit ea5a9195be
Signed by: Hesham
GPG Key ID: 74876157D199B09E

2
rsa.py
View File

@ -29,7 +29,7 @@ ID=6
def main(): def main():
print("hesham-rsa version ", VERSION) print("hesham-rsa version ", VERSION)
if len(sys.argv) > 1: if len(sys.argv) > 1:
if sys.argv[1] == "gen": ##rsa gen <keysize> <keyname> if sys.argv[1] == "gen" and len(sys.argv) == 4: ##rsa gen <keysize> <keyname>
keyFileName = sys.argv[3] keyFileName = sys.argv[3]
key = generateKeys(keyFileName, int(sys.argv[2])) key = generateKeys(keyFileName, int(sys.argv[2]))
print("e: ", key[E]) print("e: ", key[E])