Check if keys dir exists. if not make it before saving to prevent exception.
This commit is contained in:
parent
936a6eebb6
commit
654cb52ca4
2
rsa.py
2
rsa.py
@ -134,6 +134,8 @@ def readKeyFile(keyName):
|
|||||||
|
|
||||||
|
|
||||||
def saveKeyFile(key, fileName):
|
def saveKeyFile(key, fileName):
|
||||||
|
if not os.path.isdir(keysFolder):
|
||||||
|
os.makedirs(keysFolder)
|
||||||
with open(keysFolder+fileName, "w") as keyFile:
|
with open(keysFolder+fileName, "w") as keyFile:
|
||||||
keyFile.write("{0}\n{1}\n{2}\n".format(hex(key[0]), hex(key[1]), hex(key[2])))
|
keyFile.write("{0}\n{1}\n{2}\n".format(hex(key[0]), hex(key[1]), hex(key[2])))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user