endEntityProfile.setValue(EndEntityProfile.AVAILCERTPROFILES, 0, "" + certProfileId);
endEntityProfile.setValue(EndEntityProfile.DEFAULTCA, 0, "" + caid);
endEntityProfile.setValue(EndEntityProfile.AVAILCAS, 0, "" + caid);
endEntityProfile.setUse(EndEntityProfile.CLEARTEXTPASSWORD, 0,true);
endEntityProfile.setValue(EndEntityProfile.CLEARTEXTPASSWORD,0,EndEntityProfile.TRUE);
endEntityProfile.removeField(DnComponents.COMMONNAME, 0); // We will add the right number of CNs later
endEntityProfileSession.addEndEntityProfile(admin, endEntityProfileName, endEntityProfile);
newEndEntityProfile = true;
} catch (EndEntityProfileExistsException e) {
throw new EJBException(e); // We just checked for this so this cannot happen
}