byte[] keystorebytes2 = null;
byte[] keystorebytes3 = null;
// CA using SHA1withRSA and 2048 bit RSA KEY
String caname1 = "TestExportRemoveRestoreCA1";
SoftCATokenInfo catokeninfo1 = new SoftCATokenInfo();
catokeninfo1.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
catokeninfo1.setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
catokeninfo1.setSignKeySpec("2048");
catokeninfo1.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
catokeninfo1.setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
catokeninfo1.setEncKeySpec("2048");
X509CAInfo cainfo1 = getNewCAInfo(caname1, catokeninfo1);
// This CA uses DSA instead
String caname2 = "TestExportRemoveRestoreCA2";
SoftCATokenInfo catokeninfo2 = new SoftCATokenInfo();
catokeninfo2.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_DSA);
catokeninfo2.setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_DSA);
catokeninfo2.setSignKeySpec("1024");
catokeninfo2.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
catokeninfo2.setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
catokeninfo2.setEncKeySpec("1024");
X509CAInfo cainfo2 = getNewCAInfo(caname2, catokeninfo2);
// This CA uses RSA but with 1024 bits
String caname3 = "TestExportRemoveRestoreCA3";
SoftCATokenInfo catokeninfo3 = new SoftCATokenInfo();
catokeninfo3.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
catokeninfo3.setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
catokeninfo3.setSignKeySpec("1024");
catokeninfo3.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
catokeninfo3.setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
catokeninfo3.setEncKeySpec("1024");
X509CAInfo cainfo3 = getNewCAInfo(caname3, catokeninfo3);
// Remove CAs if they already exists
try {
caSession.removeCA(admin, cainfo1.getCAId());