* c: rsa_generate
*/
private static void rsaGenerate(PKeyRSA rsa, int keysize, BigInteger exp) throws RaiseException {
try {
KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA");
gen.initialize(new RSAKeyGenParameterSpec(keysize, exp), new SecureRandom());
KeyPair pair = gen.generateKeyPair();
rsa.privKey = (RSAPrivateCrtKey) (pair.getPrivate());
rsa.pubKey = (RSAPublicKey) (pair.getPublic());
} catch (Exception e) {
throw newRSAError(rsa.getRuntime(), e.getMessage());