LOGGER.info("KeyPair generation started with algorithm: {} and key size: {}", encryptionAlgorithm, keySize);
return createKeyPairGenerator().generateKeyPair();
} catch (NoSuchAlgorithmException e) {
- LOGGER.error("Generation of KeyPair failed, exception message: {}", e.getMessage());
- throw new KeyPairGenerationException(e);
+ String errorMessage = String.format("Generation of KeyPair failed, exception message: %s", e.getMessage());
+ throw new KeyPairGenerationException(errorMessage);
}
}
public class KeyPairGenerationException extends ExitableException {
private static final ExitStatus EXIT_STATUS = ExitStatus.KEY_PAIR_GENERATION_EXCEPTION;
- public KeyPairGenerationException(Throwable e) {
- super(e);
+ public KeyPairGenerationException(String errorMessage) {
+ super(errorMessage);
}
+
public ExitStatus applicationExitStatus() {
return EXIT_STATUS;
}