Netwrapper key gen
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-04-25 16:38:46 +02:00
parent 3dbde8fbb8
commit f1220dd49e
2 changed files with 8 additions and 8 deletions

View File

@@ -12,7 +12,7 @@ def generatePrivateKeyForUser(auth: Authetication,username: str, user_passphrase
private_key = RSA.generate(2048)
public_key = private_key.publickey()
private_key_value = bytes.hex(private_key.exportKey('DER', passphrase=user_passphrase, pkcs=8))
private_key_value = bytes.hex(private_key.exportKey('DER', passphrase=user_passphrase, pkcs=8, protection="scryptAndAES128-CBC"))
public_key_value = bytes.hex(public_key.exportKey('DER', pkcs=8))
##Save private key in separate file
@@ -44,7 +44,7 @@ def generatePrivateKeyForServer(auth: Authetication,passphrase: str) -> str:
private_key = RSA.generate(2048)
public_key = private_key.publickey()
private_key_value = bytes.hex(private_key.exportKey('DER', passphrase=passphrase, pkcs=8))
private_key_value = bytes.hex(private_key.exportKey('DER', passphrase=passphrase, pkcs=8, protection="scryptAndAES128-CBC"))
public_key_value = bytes.hex(public_key.exportKey('DER', pkcs=8))
data['serverPrivateKey'] = private_key_value