UserDataVO cainfodata = new UserDataVO("nobody", ca.getSubjectDN(), ca.getSubjectDN().hashCode(), subjectAltName, null, 0, 0, 0, ca
.getCertificateProfileId(), null, null, 0, 0, null);
CertificateProfile certprofile = certificateProfileSession.getCertificateProfile(admin, ca.getCertificateProfileId());
String sequence = caToken.getCATokenInfo().getKeySequence(); // get from CAtoken to make sure it is fresh
cacertificate = signca.generateCertificate(cainfodata, ca.getCAToken().getPublicKey(SecConst.CAKEYPURPOSE_CERTSIGN), -1, ca
.getValidity(), certprofile, sequence);
// Build Certificate Chain
Collection<Certificate> rootcachain = signca.getCertificateChain();
cachain = new ArrayList<Certificate>();
cachain.add(cacertificate);