/**
* @see org.ejbca.core.ejb.ca.caadmin.CAAdminSessionBean
*/
public void publishCA(int caid){
CAInfo cainfo = caadminsession.getCAInfo(administrator, caid);
Collection<Integer> publishers = cainfo.getCRLPublishers();
// Publish ExtendedCAServices certificates as well
Iterator<ExtendedCAServiceInfo> iter = cainfo.getExtendedCAServiceInfos().iterator();
while(iter.hasNext()){
ExtendedCAServiceInfo next = iter.next();
// Only publish certificates for active services
if (next.getStatus() == ExtendedCAServiceInfo.STATUS_ACTIVE) {
// The OCSP certificate is the same as the CA signing certificate
if(next instanceof XKMSCAServiceInfo){
List<Certificate> xkmscert = ((XKMSCAServiceInfo) next).getXKMSSignerCertificatePath();
if (xkmscert != null) {
caadminsession.publishCACertificate(administrator, xkmscert, publishers, cainfo.getSubjectDN());
}
}
if(next instanceof CmsCAServiceInfo){
List<Certificate> cmscert = ((CmsCAServiceInfo) next).getCertificatePath();
if (cmscert != null) {
caadminsession.publishCACertificate(administrator, cmscert, publishers, cainfo.getSubjectDN());
}
}
}
}
CertificateProfile certprofile = certificateProfileSession.getCertificateProfile(administrator, cainfo.getCertificateProfileId());
// A CA certificate is published where the CRL is published and if there is a publisher noted in the certificate profile
// (which there is probably not)
publishers.addAll(certprofile.getPublisherList());
caadminsession.publishCACertificate(administrator, cainfo.getCertificateChain(), publishers, cainfo.getSubjectDN());
crlCreateSession.publishCRL(administrator, (Certificate) cainfo.getCertificateChain().iterator().next(), publishers, cainfo.getSubjectDN(), cainfo.getDeltaCRLPeriod()>0);
}