Remove password field where not needed and set password on returned
keypair.
@@ -62,7 +62,7 @@ public class KeyGeneratorImpl implements KeyGenerator {
encryptedPrivateKey.getAsalt(),
encryptedPrivateKey.getSbox(),
encryptedPrivateKey.getArgonOptions(),
- password
+ null
),
PrivateKeyType.LOCKED
),
@@ -109,7 +109,11 @@ public class KeyGeneratorImpl implements KeyGenerator {
LOGGER.info("Saved public key to {}", publicKeyPath.toAbsolutePath().toString());
LOGGER.info("Saved private key to {}", privateKeyPath.toAbsolutePath().toString());
- return new FilesystemKeyPair(publicKeyPath, privateKeyPath);
+ final FilesystemKeyPair keyPair = new FilesystemKeyPair(publicKeyPath, privateKeyPath);
+
+ keyPair.withPassword(password);
+
+ return keyPair;
}
}
