throw new Exception("Key Algorithm '"+keyAlgorithm+"' is not supported.");
}
// Create a KeystoreInstance and generate keypair
KeystoreInstance caKeystore = createCAKeystoreInstance(request, password, KeystoreUtil.defaultType);
caKeystore.unlockKeystore(password.toCharArray());
caKeystore.generateKeyPair(alias, password.toCharArray(), password.toCharArray(), keyAlgorithm, Integer.parseInt(keySize),
algorithm, 365, caCN, caOU, caO, caL, caST, caC);
caKeystore.unlockPrivateKey(alias, password.toCharArray(), password.toCharArray());
// Create CertificationAuthority, CertificateStore and CertificateRequestStore GBeans
createCARelatedGBeans(request, (GeronimoManagedBean)caKeystore, defaultCAStoreDir, defaultCSRStoreDir);