getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_INFO_CERTPROFILE, "New certificateprofile " + newcertificateprofilename + " used profile " + originalcertificateprofilename + " as template.");
getLogSession().log(admin, admin.getCaId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_INFO_CERTPROFILE, "New certificateprofile " + newcertificateprofilename + " used profile " + originalcertificateprofilename + " as template.");
    public void cloneCertificateProfile(Admin admin, String originalcertificateprofilename, String newcertificateprofilename) throws CertificateProfileExistsException {        CertificateProfile certificateprofile = null;        if (isCertificateProfileNameFixed(newcertificateprofilename)) {            getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_ERROR_CERTPROFILE, "Error adding certificaterprofile " + newcertificateprofilename + " using profile " + originalcertificateprofilename + " as template.");            throw new CertificateProfileExistsException();        }        try {            certificateprofile = (CertificateProfile) getCertificateProfile(admin, originalcertificateprofilename).clone();            boolean issuperadministrator = false;            try {                issuperadministrator = getAuthorizationSession().isAuthorizedNoLog(admin, "/super_administrator");            } catch (AuthorizationDeniedException ade) {            }            if (!issuperadministrator && certificateprofile.isApplicableToAnyCA()) {                // Not superadministrator, do not use ANYCA;                Collection authcas = getAuthorizationSession().getAuthorizedCAIds(admin);                certificateprofile.setAvailableCAs(authcas);            }            try {                certprofilehome.findByCertificateProfileName(newcertificateprofilename);                getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_ERROR_CERTPROFILE, "Error adding certificaterprofile " + newcertificateprofilename + " using profile " + originalcertificateprofilename + " as template.");                throw new CertificateProfileExistsException();            } catch (FinderException e) {                try {                    certprofilehome.create(new Integer(findFreeCertificateProfileId()), newcertificateprofilename, certificateprofile);                    getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(), null, null, LogEntry.EVENT_INFO_CERTPROFILE, "New certificateprofile " + newcertificateprofilename + " used profile " + originalcertificateprofilename + " as template.");                } catch (CreateException f) {                }            }        } catch (CloneNotSupportedException f) {        }    } // cloneCertificateProfile