* Note, we'd like to migrate to this, but it takes too long given https://code.google.com/p/google-web-toolkit/issues/detail?id=8310
* @param strength
* @return
*/
public static AsymmetricCipherKeyPair makeKeypairSlow(Strength strength) {
RSAKeyPairGenerator generator = new RSAKeyPairGenerator();
// see https://code.google.com/p/gwt-crypto/issues/detail?id=25
SecureRandom random = SecureRandom.getInstance(null);
BigInteger exponent = BigInteger.valueOf(65537);
RSAKeyGenerationParameters params = new RSAKeyGenerationParameters(
exponent,
random,
strength.strength,
80);
generator.init(params);
// see https://code.google.com/p/gwt-crypto/issues/detail?id=26
return generator.generateKeyPair();
}