int strength = keyLength.value();
BigInteger publicExp = new BigInteger("10001", 16); // Fermat F4, largest known fermat prime
try {
JDKKeyPairGenerator gen = new JDKKeyPairGenerator.RSA();
RSAKeyGenParameterSpec params = new RSAKeyGenParameterSpec(strength, publicExp);
gen.initialize(params, new SecureRandom());
return gen.generateKeyPair();
} catch (InvalidAlgorithmParameterException e) {
logger.error("Exception whil RSA key pair generation:", e);
}
return null;