Examples of CertificateProfile


Examples of org.ejbca.core.model.ca.certificateprofiles.CertificateProfile

            returnval.add(Integer.valueOf(SecConst.CERTPROFILE_FIXED_HARDTOKENAUTHENC));
            returnval.add(Integer.valueOf(SecConst.CERTPROFILE_FIXED_HARDTOKENENC));
            returnval.add(Integer.valueOf(SecConst.CERTPROFILE_FIXED_HARDTOKENSIGN));
        }
        for (final Entry<Integer,CertificateProfile> cpEntry : profileCache.getProfileCache(entityManager).entrySet()) {
          final CertificateProfile profile = cpEntry.getValue();
          // Check if all profiles available CAs exists in authorizedcaids.
          if (certprofiletype == 0 || certprofiletype == profile.getType() || (profile.getType() == SecConst.CERTTYPE_ENDENTITY &&
                  certprofiletype == SecConst.CERTTYPE_HARDTOKEN)) {
            boolean allexists = true;
            for (final Integer nextcaid : profile.getAvailableCAs()) {
              if (nextcaid.intValue() == CertificateProfile.ANYCA) {
                allexists = true;
                break;
              }
              if (!authorizedcaids.contains(nextcaid)) {
View Full Code Here

Examples of org.ejbca.core.model.ca.certificateprofiles.CertificateProfile

    @Override
    public CertificateProfile getCertificateProfile(final Admin admin, final int id) {
        if (LOG.isTraceEnabled()) {
            LOG.trace(">getCertificateProfile(" + id + ")");
        }
        CertificateProfile returnval = null;
        if (id < SecConst.FIXED_CERTIFICATEPROFILE_BOUNDRY) {
            switch (id) {
            case SecConst.CERTPROFILE_FIXED_ENDUSER:
                returnval = new EndUserCertificateProfile();
                break;
            case SecConst.CERTPROFILE_FIXED_SUBCA:
                returnval = new CACertificateProfile();
                break;
            case SecConst.CERTPROFILE_FIXED_ROOTCA:
                returnval = new RootCACertificateProfile();
                break;
            case SecConst.CERTPROFILE_FIXED_OCSPSIGNER:
                returnval = new OCSPSignerCertificateProfile();
                break;
            case SecConst.CERTPROFILE_FIXED_SERVER:
                returnval = new ServerCertificateProfile();
                break;
            case SecConst.CERTPROFILE_FIXED_HARDTOKENAUTH:
                returnval = new HardTokenAuthCertificateProfile();
                break;
            case SecConst.CERTPROFILE_FIXED_HARDTOKENAUTHENC:
                returnval = new HardTokenAuthEncCertificateProfile();
                break;
            case SecConst.CERTPROFILE_FIXED_HARDTOKENENC:
                returnval = new HardTokenEncCertificateProfile();
                break;
            case SecConst.CERTPROFILE_FIXED_HARDTOKENSIGN:
                returnval = new HardTokenSignCertificateProfile();
                break;
            default:
                returnval = new EndUserCertificateProfile();
            }
        } else {
        // We need to clone the profile, otherwise the cache contents will be modifyable from the outside
          final CertificateProfile cprofile = profileCache.getProfileCache(entityManager).get(Integer.valueOf(id));
        try {
          if (cprofile != null) {
            returnval = (CertificateProfile)cprofile.clone();
          }
        } catch (CloneNotSupportedException e) {
          LOG.error("Should never happen: ", e);
          throw new RuntimeException(e);
        }
View Full Code Here

Examples of org.ejbca.core.model.ca.certificateprofiles.CertificateProfile

    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    @Override
    public void cloneCertificateProfile(final Admin admin, final String orgprofilename, final String newprofilename,
            final Collection<Integer> authorizedCaIds) throws CertificateProfileExistsException {
        CertificateProfile profile = null;
        if (isCertificateProfileNameFixed(newprofilename)) {
            final String msg = INTRES.getLocalizedMessage("store.errorcertprofilefixed", newprofilename);
            logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new Date(), null, null, LogConstants.EVENT_ERROR_CERTPROFILE,
                    msg);
            throw new CertificateProfileExistsException(msg);
        }
        try {
            profile = (CertificateProfile) getCertificateProfile(admin, orgprofilename).clone();
            boolean issuperadmin = false;
            issuperadmin = authSession.isAuthorizedNoLog(admin, "/super_administrator");
            if (!issuperadmin && profile.isApplicableToAnyCA()) {
                // Not superadministrator, do not use ANYCA;
                profile.setAvailableCAs(authorizedCaIds);
            }
            if (CertificateProfileData.findByProfileName(entityManager, newprofilename) == null) {
                entityManager.persist(new CertificateProfileData(findFreeCertificateProfileId(), newprofilename, profile));
                flushProfileCache();
                final String msg = INTRES.getLocalizedMessage("store.addedprofilewithtempl", newprofilename, orgprofilename);
View Full Code Here

Examples of org.ejbca.core.model.ca.certificateprofiles.CertificateProfile

    }

    @Override
    public boolean existsCAInCertificateProfiles(final Admin admin, final int caid) {
      for (final Entry<Integer,CertificateProfile> cpEntry : profileCache.getProfileCache(entityManager).entrySet()) {
        final CertificateProfile certProfile = cpEntry.getValue();
        if (certProfile.getType() == CertificateProfile.TYPE_ENDENTITY) {
          for (Integer availableCaId : certProfile.getAvailableCAs()) {
            if (availableCaId.intValue() == caid) {
              if (LOG.isDebugEnabled()) {
                LOG.debug("CA exists in certificate profile " + cpEntry.getKey().toString());
              }
              return true;
View Full Code Here

Examples of org.ejbca.core.model.ca.certificateprofiles.CertificateProfile

      }

      ejbhelper.isAuthorizedToRepublish(admin, certreqhist.getUsername(),bcIssuerDN.hashCode());

      if(certreqhist != null){
        CertificateProfile certprofile = certificateProfileSession.getCertificateProfile(admin,certreqhist.getUserDataVO().getCertificateProfileId());
        java.security.cert.Certificate cert = certificateStoreSession.findCertificateByFingerprint(admin, certreqhist.getFingerprint());
        if(certprofile != null){
          CertificateInfo certinfo = certificateStoreSession.getCertificateInfo(admin, certreqhist.getFingerprint());
          if(certprofile.getPublisherList().size() > 0){
            if(publisherSession.storeCertificate(admin, certprofile.getPublisherList(), cert, certreqhist.getUserDataVO().getUsername(), certreqhist.getUserDataVO().getPassword(), certreqhist.getUserDataVO().getDN(),
                certinfo.getCAFingerprint(), certinfo.getStatus() , certinfo.getType(), certinfo.getRevocationDate().getTime(), certinfo.getRevocationReason(), certinfo.getTag(), certinfo.getCertificateProfileId(), certinfo.getUpdateTime().getTime(), certreqhist.getUserDataVO().getExtendedinformation())){
            }else{
              throw new PublisherException("Error: publication failed to at least one of the defined publishers.");
            }
          }else{
View Full Code Here

Examples of org.ejbca.core.model.ca.certificateprofiles.CertificateProfile

                                        certificateProfileIdMapping.put(profileid, newprofileid);
                                        profileid = newprofileid;
                                    }
                                }
                                if (!error) {
                                    CertificateProfile cprofile = null;
                                    EndEntityProfile eprofile = null;
                                    FileInputStream is = new FileInputStream(infiles[i]);
                                    XMLDecoder decoder = new XMLDecoder( is );
                                    if (entityprofile) {
                                        eprofile = new EndEntityProfile();
                                        eprofile.loadData(decoder.readObject());
                                        // Translate cert profile ids that have changed after import
                                        String availableCertProfiles = "";
                                        String defaultCertProfile = eprofile.getValue(EndEntityProfile.DEFAULTCERTPROFILE,0);
                                      //getLogger().debug("Debug: Org - AVAILCERTPROFILES " + eprofile.getValue(EndEntityProfile.AVAILCERTPROFILES,0) + " DEFAULTCERTPROFILE "+defaultCertProfile);
                                        for (String currentCertProfile : (Collection<String>) eprofile.getAvailableCertificateProfileIds()) {
                                          Integer currentCertProfileId = Integer.parseInt(currentCertProfile);
                                          Integer replacementCertProfileId = certificateProfileIdMapping.get(currentCertProfileId);
                                          if ( replacementCertProfileId != null ) {
                                            if (!replacementCertProfileId.toString().equals(currentCertProfile)) {
                                              getLogger().warn("Replacing cert profile with id "+currentCertProfile+" with " + replacementCertProfileId + ".");
                                            }
                                            availableCertProfiles += (availableCertProfiles.equals("") ? "" : ";" ) + replacementCertProfileId;
                                            if (currentCertProfile.equals(defaultCertProfile)) {
                                              defaultCertProfile = ""+replacementCertProfileId;
                                            }
                                          } else {
                                            if (ejb.getCertificateProfileSession().getCertificateProfile(getAdmin(), currentCertProfileId) != null ||
                                                SecConst.isFixedCertificateProfile(currentCertProfileId)) {
                                                availableCertProfiles += (availableCertProfiles.equals("") ? "" : ";" ) + currentCertProfile;
                                             } else {
                                               getLogger().warn("End Entity Profile '"+profilename+"' references certificate profile " + currentCertProfile + " that does not exist.");
                                                if (currentCertProfile.equals(defaultCertProfile)) {
                                                  defaultCertProfile = "";
                                                }
                                             }
                                          }
                                        }
                                        if (availableCertProfiles.equals("")) {
                                          getLogger().warn("End Entity Profile only references certificate profile(s) that does not exist. Using ENDUSER profile.");
                                            availableCertProfiles = "1"; // At least make sure the default profile is available
                                        }
                                        if (defaultCertProfile.equals("")) {
                                          defaultCertProfile = availableCertProfiles.split(";")[0]// Use first available profile from list as default if original default was missing
                                        }
                                        eprofile.setValue(EndEntityProfile.AVAILCERTPROFILES, 0, availableCertProfiles);
                                        eprofile.setValue(EndEntityProfile.DEFAULTCERTPROFILE,0, defaultCertProfile);
                                        // Remove any unknown CA and break if none is left
                                        String defaultCA = eprofile.getValue(EndEntityProfile.DEFAULTCA,0);
                                        String availableCAs = eprofile.getValue(EndEntityProfile.AVAILCAS,0);
                                      //getOutputStream().println("Debug: Org - AVAILCAS " + availableCAs + " DEFAULTCA "+defaultCA);
                                        List<String> cas = Arrays.asList(availableCAs.split(";"));
                                        availableCAs = "";
                                        for ( String currentCA : cas ) {
                                          Integer currentCAInt = Integer.parseInt(currentCA);
                                          // The constant ALLCAS will not be searched for among available CAs
                                          if ( (currentCAInt.intValue() != SecConst.ALLCAS) && (ejb.getCAAdminSession().getCAInfo(getAdmin(), currentCAInt) == null) ) {
                                            getLogger().warn("CA with id " + currentCA + " was not found and will not be used in end entity profile '" + profilename + "'.");
                                                if (defaultCA.equals(currentCA)) {
                                                  defaultCA = "";
                                                }
                                          } else {
                                            availableCAs += (availableCAs.equals("") ? "" : ";" ) + currentCA;
                                          }
                                        }
                                        if (availableCAs.equals("")) {
                                          if (caid == null) {
                                            getLogger().error("No CAs left in end entity profile '" + profilename + "' and no CA specified on command line. Using ALLCAs.");
                                            availableCAs = Integer.toString(SecConst.ALLCAS);
                                          } else {
                                            availableCAs = Integer.toString(caid);
                                            getLogger().warn("No CAs left in end entity profile '" + profilename + "'. Using CA supplied on command line with id '"+caid+"'.");
                                          }
                                        }
                                        if (defaultCA.equals("")) {
                                          defaultCA = availableCAs.split(";")[0]// Use first available
                                          getLogger().warn("Changing default CA in end entity profile '" + profilename + "' to "+defaultCA+".");
                                        }
                                      //getLogger().debug("New - AVAILCAS " + availableCAs + " DEFAULTCA "+defaultCA);
                                        eprofile.setValue(EndEntityProfile.AVAILCAS, 0, availableCAs);
                                        eprofile.setValue(EndEntityProfile.DEFAULTCA, 0, defaultCA);
                                        try{                                       
                                            ejb.getEndEntityProfileSession().addEndEntityProfile(getAdmin(),profileid,profilename,eprofile);
                                            getLogger().info("Added entity profile '"+profilename+"' to database.");
                                        }catch(EndEntityProfileExistsException eepee){ 
                                          getLogger().error("Error adding entity profile '"+profilename+"' to database.");
                                        }                                       
                                    } else {
                                        cprofile = new CertificateProfile();
                                        cprofile.loadData(decoder.readObject());
                                        // Make sure CAs in profile exist
                                        Collection<Integer> cas = cprofile.getAvailableCAs();
                                        ArrayList<Integer> casToRemove = new ArrayList<Integer>();
                                        for (Integer currentCA : cas) {
                                          if (currentCA != CertificateProfile.ANYCA && ejb.getCAAdminSession().getCAInfo(getAdmin(), currentCA) == null) {
                                            casToRemove.add(currentCA);
                                          }
                                        }
                                        for (Integer toRemove : casToRemove) {
                                          getLogger().warn("Warning: CA with id " + toRemove + " was not found and will not be used in certificate profile '" + profilename + "'.");
                                          cas.remove(toRemove);
                                        }
                                        if (cas.size() == 0) {
                                          if (caid == null) {
                                            getLogger().error("Error: No CAs left in certificate profile '" + profilename + "' and no CA specified on command line. Using ANYCA.");
                                            cas.add(Integer.valueOf(CertificateProfile.ANYCA));
                                          } else {
                                            getLogger().warn("Warning: No CAs left in certificate profile '" + profilename + "'. Using CA supplied on command line with id '"+caid+"'.");
                                              cas.add(caid);
                                          }
                                        }
                                        cprofile.setAvailableCAs(cas);
                                        // Remove and warn about unknown publishers
                                        Collection<Integer> publishers = cprofile.getPublisherList();
                                        ArrayList<Integer> allToRemove = new ArrayList<Integer>();
                                        for (Integer publisher : publishers) {
                                          BasePublisher pub = null;
                                          try {
                                            pub = ejb.getPublisherSession().getPublisher(getAdmin(), publisher);
                                          } catch (Exception e) {
                                            String msg = e.getMessage();
                                            if (e.getCause() != null) {
                                              msg += ": "+e.getCause().getMessage();
                                            }
                                            getLogger().warn("Warning: There was an error loading publisher with id " + publisher + ". Use debug logging to see stack trace: "+e.getMessage());
                                            getLogger().debug("Full stack trace: ", e);
                                          }
                                          if (pub == null) {
                                            allToRemove.add(publisher);
                                          }
                                        }
                                        for (Integer toRemove : allToRemove) {
                                          getLogger().warn("Warning: Publisher with id " + toRemove + " was not found and will not be used in certificate profile '" + profilename + "'.");
                                          publishers.remove(toRemove);
                                        }
                                        cprofile.setPublisherList(publishers);
                                        // Add profile
                                        try{
                                            ejb.getCertificateProfileSession().addCertificateProfile(getAdmin(),profileid,profilename,cprofile);
                                            certificateProfileIdMapping.put(profileid, ejb.getCertificateProfileSession().getCertificateProfileId(getAdmin(),profilename));
                                            getLogger().info("Added certificate profile '"+profilename+"' to database.");
View Full Code Here

Examples of org.ejbca.core.model.ca.certificateprofiles.CertificateProfile

      X509Certificate cacert = CertTools.genSelfCertForPurpose("CN=dummy2", 100, null, keys.getPrivate(), keys.getPublic(),
          AlgorithmConstants.SIGALG_SHA1_WITH_RSA, true, X509KeyUsage.cRLSign|X509KeyUsage.keyCertSign);

      UserDataVO subject = new UserDataVO();

      final CertificateProfile cp = new EndUserCertificateProfile();
      cp.setValidity(encodedValidity);
      cp.setAllowValidityOverride(false);
   
      // First see that when we don't have a specified time requested and validity override is not allowed, the end time shouldbe ruled by the certificate profile.
     
      CertificateValidity cv = new CertificateValidity(subject, cp, null, null, cacert, false);
      Date notBefore = cv.getNotBefore();
      Date notAfter = cv.getNotAfter();
      Date now = new Date();
        Calendar cal1 = Calendar.getInstance();
        cal1.add(Calendar.DAY_OF_MONTH, 49);
        Calendar cal2 = Calendar.getInstance();
        cal2.add(Calendar.DAY_OF_MONTH, 51);
      assertTrue(notBefore.before(now));
      assertTrue(notAfter.after(cal1.getTime()));
      assertTrue(notAfter.before(cal2.getTime()));
     
      // See that a requested validity does not affect it
        Calendar requestNotBefore = Calendar.getInstance();
        requestNotBefore.add(Calendar.DAY_OF_MONTH, 2);
        Calendar requestNotAfter = Calendar.getInstance();
        requestNotAfter.add(Calendar.DAY_OF_MONTH, 25);
        cv = new CertificateValidity(subject, cp, requestNotBefore.getTime(), requestNotAfter.getTime(), cacert, false);
      notBefore = cv.getNotBefore();
      notAfter = cv.getNotAfter();
      assertTrue(notBefore.before(now));
      assertTrue(notAfter.after(cal1.getTime()));
      assertTrue(notAfter.before(cal2.getTime()));
     
      // Add extended information for the user and see that it does not affect it either
      ExtendedInformation ei = new ExtendedInformation();
      ei.setCustomData(EndEntityProfile.STARTTIME, "10:0:0");
      ei.setCustomData(EndEntityProfile.ENDTIME, "30:0:0");
      subject.setExtendedinformation(ei);
        cv = new CertificateValidity(subject, cp, requestNotBefore.getTime(), requestNotAfter.getTime(), cacert, false);
      notBefore = cv.getNotBefore();
      notAfter = cv.getNotAfter();
      assertTrue(notBefore.before(now));
      assertTrue(notAfter.after(cal1.getTime()));
      assertTrue(notAfter.before(cal2.getTime()));
     
      // Now allow validity override
      cp.setAllowValidityOverride(true);
     
      // Now we should get what's in the UserDataVO extended information
        cv = new CertificateValidity(subject, cp, requestNotBefore.getTime(), requestNotAfter.getTime(), cacert, false);
      notBefore = cv.getNotBefore();
      notAfter = cv.getNotAfter();
        cal1 = Calendar.getInstance();
        cal1.add(Calendar.DAY_OF_MONTH, 9);
        cal2 = Calendar.getInstance();
        cal2.add(Calendar.DAY_OF_MONTH, 11);
      assertTrue(notBefore.after(cal1.getTime()));
      assertTrue(notBefore.before(cal2.getTime()));
        cal1 = Calendar.getInstance();
        cal1.add(Calendar.DAY_OF_MONTH, 29);
        cal2 = Calendar.getInstance();
        cal2.add(Calendar.DAY_OF_MONTH, 31);
      assertTrue(notAfter.after(cal1.getTime()));
      assertTrue(notAfter.before(cal2.getTime()));
     
      // Remove extended information from UserDataVO and we should get what we pass as parameters to CertificateValidity
      subject.setExtendedinformation(null);
        cv = new CertificateValidity(subject, cp, requestNotBefore.getTime(), requestNotAfter.getTime(), cacert, false);
      notBefore = cv.getNotBefore();
      notAfter = cv.getNotAfter();
        cal1 = Calendar.getInstance();
        cal1.add(Calendar.DAY_OF_MONTH, 1);
        cal2 = Calendar.getInstance();
        cal2.add(Calendar.DAY_OF_MONTH, 3);
      assertTrue(notBefore.after(cal1.getTime()));
      assertTrue(notBefore.before(cal2.getTime()));
        cal1 = Calendar.getInstance();
        cal1.add(Calendar.DAY_OF_MONTH, 23);
        cal2 = Calendar.getInstance();
        cal2.add(Calendar.DAY_OF_MONTH, 26);
      assertTrue(notAfter.after(cal1.getTime()));
      assertTrue(notAfter.before(cal2.getTime()));
     
      // Check that we can not supersede the certificate profile end time
        requestNotAfter = Calendar.getInstance();
        requestNotAfter.add(Calendar.DAY_OF_MONTH, 200);
        cv = new CertificateValidity(subject, cp, requestNotBefore.getTime(), requestNotAfter.getTime(), cacert, false);
      notBefore = cv.getNotBefore();
      notAfter = cv.getNotAfter();
        cal1 = Calendar.getInstance();
        cal2 = Calendar.getInstance();
        // This will be counted in number of days since notBefore, and notBefore here is taken from requestNotBefore which is two,
        // so we have to add 2 to certificate profile validity to get the resulting notAfter but not if certificate end is an
        // absolute end date.
        if ( encodedValidity > Integer.MAX_VALUE) {
            cal1.add(Calendar.DAY_OF_MONTH, 49);
            cal2.add(Calendar.DAY_OF_MONTH, 51);
        } else {
            cal1.add(Calendar.DAY_OF_MONTH, 51);
            cal2.add(Calendar.DAY_OF_MONTH, 53);           
        }
      assertTrue(notAfter.after(cal1.getTime()));
      assertTrue(notAfter.before(cal2.getTime()));

      // Check that we can not supersede the CA end time
      cp.setValidity(400);
        cv = new CertificateValidity(subject, cp, requestNotBefore.getTime(), requestNotAfter.getTime(), cacert, false);
      notBefore = cv.getNotBefore();
      notAfter = cv.getNotAfter();
        // This will be the CA certificate's notAfter
        cal1 = Calendar.getInstance();
View Full Code Here

Examples of org.ejbca.core.model.ca.certificateprofiles.CertificateProfile

     * @return CertificateProfile
     *
     * TODO: Verify read-only? apply read-only?
     */
    private CertificateProfile readAndUpgradeProfileInternal() {
        CertificateProfile returnval = null;
        switch (((Integer) (getData().get(CertificateProfile.TYPE))).intValue()) {
            case CertificateProfile.TYPE_ROOTCA:
                returnval = new RootCACertificateProfile();
                break;
            case CertificateProfile.TYPE_SUBCA:
                returnval = new CACertificateProfile();
                break;
            case CertificateProfile.TYPE_ENDENTITY:
            default :
                returnval = new EndUserCertificateProfile();
        }
        final HashMap data = getData();
        // If CertificateProfile-data is upgraded we want to save the new data, so we must get the old version before loading the data
        // and perhaps upgrading
        final float oldversion = ((Float) data.get(UpgradeableDataHashMap.VERSION)).floatValue();
        // Load the profile data, this will potentially upgrade the CertificateProfile
        returnval.loadData(data);
        if (Float.compare(oldversion, returnval.getVersion()) != 0) {
          // Save new data versions differ
          setCertificateProfile(returnval);
        }
        return returnval;
    }
View Full Code Here

Examples of org.ejbca.core.model.ca.certificateprofiles.CertificateProfile

  }
 
  public void test02StandardCertificateExtensions() throws Exception{
   
    CertificateExtensionFactory fact = CertificateExtensionFactory.getInstance();
      CertificateProfile profile = new CertificateProfile();
      profile.setUseAuthorityInformationAccess(true);
      profile.setUseCertificatePolicies(true);
      profile.setUseCRLDistributionPoint(true);
      profile.setUseFreshestCRL(true);
      profile.setUseMicrosoftTemplate(true);
      profile.setUseOcspNoCheck(true);
      profile.setUseQCStatement(true);
      profile.setUseExtendedKeyUsage(true);
      profile.setUseSubjectDirAttributes(true);
        List usedStdCertExt = profile.getUsedStandardCertificateExtensions();
        assertEquals(usedStdCertExt.size(), 14);
        Iterator certStdExtIter = usedStdCertExt.iterator();
        while(certStdExtIter.hasNext()){
          String oid = (String)certStdExtIter.next();
          CertificateExtension certExt = fact.getStandardCertificateExtension(oid, profile);
View Full Code Here

Examples of org.ejbca.core.model.ca.certificateprofiles.CertificateProfile

        }

        // Create CA
        CA ca = null;
        // The certificate profile used for the CAs certificate
        CertificateProfile certprofile = certificateProfileSession.getCertificateProfile(admin, cainfo.getCertificateProfileId());
        // AltName is not implemented for all CA types
        String caAltName = null;
        // X509 CA is the normal type of CA
        if (cainfo instanceof X509CAInfo) {
            log.info("Creating an X509 CA");
            X509CAInfo x509cainfo = (X509CAInfo) cainfo;
            // Create X509CA
            ca = new X509CA(x509cainfo);
            X509CA x509ca = (X509CA) ca;
            ca.setCAToken(catoken);

            // getCertificateProfile
            if ((x509cainfo.getPolicies() != null) && (x509cainfo.getPolicies().size() > 0)) {
                certprofile.setUseCertificatePolicies(true);
                certprofile.setCertificatePolicies(x509cainfo.getPolicies());
            } else if (certprofile.getUseCertificatePolicies()) {
                x509ca.setPolicies(certprofile.getCertificatePolicies());
            }
            caAltName = x509cainfo.getSubjectAltName();
        } else {
            // CVC CA is a special type of CA for EAC electronic passports
            log.info("Creating a CVC CA");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.