Skip to content

Commit

Permalink
Updates for the keys generator tool (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmdkrmabd authored Aug 21, 2024
1 parent 58e6b66 commit abc1f8c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions keys_generator/keys_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ def generateKeys(length):

# Check that they're saved in the OS keychain and valid if so
# If not, then create both keys
if publicKey is None or privateKey is None or \
len(publicKey) != 271 or len(privateKey) != 886:
if publicKey is None or privateKey is None:
keys = RSA.generate(length) # Setting the length to 4096 caused a failure on Windows (issue #105)

# Get public and private keys,
Expand All @@ -69,6 +68,9 @@ def generateKeys(length):


try:
if system() == 'Windows':
raise Exception()

generateKeys(int(getenv("RSA_KEY_LENGTH", 2048)))
except:
try:
Expand All @@ -80,4 +82,4 @@ def generateKeys(length):
# Print the public key
print(publicKey)
except:
pass
pass

0 comments on commit abc1f8c

Please sign in to comment.