*/
private void activateAndPublishExternalCAServices(Admin admin, Collection<ExtendedCAServiceInfo> extendedCAServiceInfos, CA ca) {
// activate External CA Services
Iterator<ExtendedCAServiceInfo> iter = extendedCAServiceInfos.iterator();
while (iter.hasNext()) {
ExtendedCAServiceInfo info = (ExtendedCAServiceInfo) iter.next();
ArrayList<Certificate> certificate = new ArrayList<Certificate>();
if (info instanceof OCSPCAServiceInfo) {
try {
ca.initExternalService(ExtendedCAServiceInfo.TYPE_OCSPEXTENDEDSERVICE, ca);
// The OCSP certificate is the same as the CA signing
// certificate
} catch (Exception fe) {
String msg = intres.getLocalizedMessage("caadmin.errorcreatecaservice", "OCSPCAService");
logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new java.util.Date(), null, null, LogConstants.EVENT_ERROR_CACREATED, msg,
fe);
throw new EJBException(fe);
}
}
if (info instanceof XKMSCAServiceInfo) {
try {
ca.initExternalService(ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE, ca);
certificate.add(((XKMSCAServiceInfo) ca.getExtendedCAServiceInfo(ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE))
.getXKMSSignerCertificatePath().get(0));
} catch (Exception fe) {
String msg = intres.getLocalizedMessage("caadmin.errorcreatecaservice", "XKMSCAService");
logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new java.util.Date(), null, null, LogConstants.EVENT_ERROR_CACREATED, msg,
fe);
throw new EJBException(fe);
}
}
if (info instanceof CmsCAServiceInfo) {
try {
ca.initExternalService(ExtendedCAServiceInfo.TYPE_CMSEXTENDEDSERVICE, ca);
certificate
.add(((CmsCAServiceInfo) ca.getExtendedCAServiceInfo(ExtendedCAServiceInfo.TYPE_CMSEXTENDEDSERVICE)).getCertificatePath().get(0));
} catch (Exception fe) {
String msg = intres.getLocalizedMessage("caadmin.errorcreatecaservice", "CMSCAService");
logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new java.util.Date(), null, null, LogConstants.EVENT_ERROR_CACREATED, msg,
fe);
throw new EJBException(fe);
}
}
// Always store the certificate. Only publish the extended service
// certificate for active services.
Collection<Integer> publishers = null;
if (info.getStatus() == ExtendedCAServiceInfo.STATUS_ACTIVE) {
publishers = ca.getCRLPublishers();
}
if ((!certificate.isEmpty())) {
publishCACertificate(admin, certificate, publishers, ca.getSubjectDN());
}