This commit is contained in:
parent
7c0e66c450
commit
f8161f34fa
@ -135,14 +135,14 @@ class Authetication:
|
|||||||
return dictionary
|
return dictionary
|
||||||
|
|
||||||
|
|
||||||
def loadServerPrivateKey(self) -> RsaKey:
|
def loadServerPrivateKey(self, passphrase: str) -> RsaKey:
|
||||||
with open(self.CONFIG_FILE_LOCATION) as json_file:
|
with open(self.CONFIG_FILE_LOCATION) as json_file:
|
||||||
data = json.load(json_file)
|
data = json.load(json_file)
|
||||||
|
|
||||||
key = data['serverPrivateKey']
|
key = data['serverPrivateKey']
|
||||||
key = bytes.fromhex(key)
|
key = bytes.fromhex(key)
|
||||||
try:
|
try:
|
||||||
rsaKey = RSA.import_key(key)
|
rsaKey = RSA.import_key(key, passphrase)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print('Invalid server private key!')
|
print('Invalid server private key!')
|
||||||
return rsaKey
|
return rsaKey
|
||||||
|
Loading…
Reference in New Issue
Block a user