}
}
// get users Token Type.
tokentype = data.getTokenType();
GenerateToken tgen = new GenerateToken(authenticationSession, userAdminSession, caAdminSession, keyRecoverySession, signSession);
if(tokentype == SecConst.TOKEN_SOFT_P12){
KeyStore ks = tgen.generateOrKeyRecoverToken(administrator, username, password, data.getCAId(), keylength, keyalg, false, loadkeys, savekeys, reusecertificate, endEntityProfileId);
if (StringUtils.equals(openvpn, "on")) {
sendOpenVPNToken(ks, username, password, response);
} else {
sendP12Token(ks, username, password, response);
}
}
if(tokentype == SecConst.TOKEN_SOFT_JKS){
KeyStore ks = tgen.generateOrKeyRecoverToken(administrator, username, password, data.getCAId(), keylength, keyalg, true, loadkeys, savekeys, reusecertificate, endEntityProfileId);
sendJKSToken(ks, username, password, response);
}
if(tokentype == SecConst.TOKEN_SOFT_PEM){
KeyStore ks = tgen.generateOrKeyRecoverToken(administrator, username, password, data.getCAId(), keylength, keyalg, false, loadkeys, savekeys, reusecertificate, endEntityProfileId);
sendPEMTokens(ks, username, password, response);
}
if(tokentype == SecConst.TOKEN_SOFT_BROWSERGEN){
// first check if it is a Firefox request,