certGen.setNotBefore(time);
certGen.setNotAfter(new Date (time.getTime() + 1000L * 60 * 60 * 24 * 365 * 10)); // 10 years of life
certGen.setSubjectDN(dnName); // note: same as issuer
certGen.setPublicKey(key_pair.getPublic());
certGen.setSignatureAlgorithm("SHA1withRSA");
final X509Certificate certificate = certGen.generate(key_pair.getPrivate(), "BC");
final String fingerprint = CertTools.getFingerprintAsString(certificate);
// We add all certificates that does not have a user already to "missing_user_name"
final UserDataVO missingUserDataVO = ejb.getUserAdminSession().findUser(getAdmin(), missing_user_name);
if (missingUserDataVO == null) {
// Add the user and change status to REVOKED