Package org.ejbca.core.model.ca.caadmin.extendedcaservices

Examples of org.ejbca.core.model.ca.caadmin.extendedcaservices.ExtendedCAServiceInfo


    CAInfo caInfo = getCAInfo();
    boolean active = false;
    if (caInfo != null) {
      Iterator<ExtendedCAServiceInfo> iter = caInfo.getExtendedCAServiceInfos().iterator();
      while(iter.hasNext()){
          ExtendedCAServiceInfo next = (ExtendedCAServiceInfo) iter.next();
          if(next instanceof OCSPCAServiceInfo){
            active = next.getStatus() == ExtendedCAServiceInfo.STATUS_ACTIVE;
          }
      }     
    } else {
      log.debug("getOcspEnabled: caInfo is null");
    }
View Full Code Here


   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());
View Full Code Here

public void renewAndRevokeXKMSCertificate(int caid) throws CATokenOfflineException, CADoesntExistsException, UnsupportedEncodingException, IllegalKeyStoreException, AuthorizationDeniedException{
     CAInfo cainfo = caadminsession.getCAInfo(administrator, caid);
    Iterator iter = cainfo.getExtendedCAServiceInfos().iterator();
    while(iter.hasNext()){
      ExtendedCAServiceInfo next = (ExtendedCAServiceInfo) iter.next()
      if(next instanceof XKMSCAServiceInfo){
        List xkmscerts = ((XKMSCAServiceInfo) next).getXKMSSignerCertificatePath();
        if (xkmscerts != null) {
          X509Certificate xkmscert = (X509Certificate)xkmscerts.get(0);
        certificatesession.revokeCertificate(administrator,xkmscert, cainfo.getCRLPublishers(), RevokedCertInfo.REVOCATION_REASON_UNSPECIFIED, cainfo.getSubjectDN());      
View Full Code Here

public void renewAndRevokeCmsCertificate(int caid) throws CATokenOfflineException, CADoesntExistsException, UnsupportedEncodingException, IllegalKeyStoreException, AuthorizationDeniedException{
     CAInfo cainfo = caadminsession.getCAInfo(administrator, caid);
    Iterator<ExtendedCAServiceInfo> iter = cainfo.getExtendedCAServiceInfos().iterator();
    while(iter.hasNext()){
      ExtendedCAServiceInfo next = (ExtendedCAServiceInfo) iter.next()
      if(next instanceof CmsCAServiceInfo){
        List cmscerts = ((CmsCAServiceInfo) next).getCertificatePath();
        if (cmscerts != null) {
            X509Certificate cmscert = (X509Certificate)cmscerts.get(0);
          certificatesession.revokeCertificate(administrator,cmscert, cainfo.getCRLPublishers(), RevokedCertInfo.REVOCATION_REASON_UNSPECIFIED, cainfo.getSubjectDN());      
View Full Code Here

    cainfodata[OCSPSPACER]          = "&nbsp;"; // blank line
   
    boolean active = false;   
    iter = ((X509CAInfo) cainfo).getExtendedCAServiceInfos().iterator();
    while(iter.hasNext()){
        ExtendedCAServiceInfo next = (ExtendedCAServiceInfo) iter.next();
        if(next instanceof OCSPCAServiceInfo){
          active = next.getStatus() == ExtendedCAServiceInfo.STATUS_ACTIVE;
        }
    }
   
    if(active){
        cainfodata[OCSP] = ejbcawebbean.getText("ACTIVE")
View Full Code Here

      super(data);
      setExpireTime(expireTime)// Make sure the internal state is synched with the database column. Required for upgrades from EJBCA 3.5.6 or EJBCA 3.6.1 and earlier.
      ArrayList<ExtendedCAServiceInfo> externalcaserviceinfos = new ArrayList<ExtendedCAServiceInfo>();
      Iterator<Integer> iter = getExternalCAServiceTypes().iterator();  
      while(iter.hasNext()){
        ExtendedCAServiceInfo info = this.getExtendedCAServiceInfo(iter.next().intValue());
        if (info != null) {
            externalcaserviceinfos.add(info);             
        }
      }
        CAInfo info = new X509CAInfo(subjectDN, name, status, updateTime, getSubjectAltName() ,getCertificateProfileId()
View Full Code Here

        }

        // Check if extended service certificates are about to be renewed.
        Iterator<ExtendedCAServiceInfo> iter = cainfo.getExtendedCAServiceInfos().iterator();
        while (iter.hasNext()) {
          ExtendedCAServiceInfo next = iter.next();
            // No OCSP Certificate exists that can be renewed.
            if (next instanceof XKMSCAServiceInfo) {
                xkmsrenewcert = ((XKMSCAServiceInfo) next).getRenewFlag();
            } else if (next instanceof CmsCAServiceInfo) {
                cmsrenewcert = ((CmsCAServiceInfo) next).getRenewFlag();
View Full Code Here

                    while (iter.hasNext()) {
                        int type = iter.next().intValue();
                        try {
                            ca.initExternalService(type, ca);
                            ArrayList<Certificate> extcacertificate = new ArrayList<Certificate>();
                            ExtendedCAServiceInfo info = null;
                            if (type == ExtendedCAServiceInfo.TYPE_OCSPEXTENDEDSERVICE) {
                                info = (OCSPCAServiceInfo) ca.getExtendedCAServiceInfo(ExtendedCAServiceInfo.TYPE_OCSPEXTENDEDSERVICE);
                                // The OCSP certificate is the same as the
                                // singing certificate
                            }
                            if (type == ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE) {
                                info = ca.getExtendedCAServiceInfo(ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE);
                                extcacertificate.add(((XKMSCAServiceInfo) info).getXKMSSignerCertificatePath().get(0));
                            }
                            if (type == ExtendedCAServiceInfo.TYPE_CMSEXTENDEDSERVICE) {
                                info = ca.getExtendedCAServiceInfo(ExtendedCAServiceInfo.TYPE_CMSEXTENDEDSERVICE);
                                extcacertificate.add(((CmsCAServiceInfo) info).getCertificatePath().get(0));
                            }
                            // Publish the extended service certificate, but
                            // only for active services
                            if ((info != null) && (info.getStatus() == ExtendedCAServiceInfo.STATUS_ACTIVE) && (!extcacertificate.isEmpty())) {
                                publishCACertificate(admin, extcacertificate, ca.getCRLPublishers(), ca.getSubjectDN());
                            }
                        } catch (CATokenOfflineException e) {
                            String msg = intres.getLocalizedMessage("caadmin.errorcreatecaservice", Integer.valueOf(caid));
                            logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new java.util.Date(), null, null,
View Full Code Here

     */
    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());
            }
View Full Code Here

       setUseCertificateStorage(cainfo.isUseCertificateStorage());
    
     Iterator<ExtendedCAServiceInfo> iter = cainfo.getExtendedCAServiceInfos().iterator();
     ArrayList<Integer> extendedservicetypes = new ArrayList<Integer>();
     while(iter.hasNext()){
        ExtendedCAServiceInfo next = iter.next();
        if(next instanceof OCSPCAServiceInfo){
          setExtendedCAService(new OCSPCAService(next));
          extendedservicetypes.add(Integer.valueOf(ExtendedCAServiceInfo.TYPE_OCSPEXTENDEDSERVICE));
        }
        if(next instanceof XKMSCAServiceInfo){
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.ca.caadmin.extendedcaservices.ExtendedCAServiceInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.