Package org.ejbca.core.model.ca.crl

Examples of org.ejbca.core.model.ca.crl.RevokedCertInfo


                // Go through them and create a CRL, at the same time archive expired certificates
                Date now = new Date();
                Date check = new Date(now.getTime() - crlperiod);
                Iterator<RevokedCertInfo> iter = revcerts.iterator();
                while (iter.hasNext()) {
                        RevokedCertInfo data = iter.next();
                        // We want to include certificates that was revoked after the last CRL was issued, but before this one
                        // so the revoked certs are included in ONE CRL at least. See RFC5280 section 3.3.
                        if ( data.getExpireDate().before(check) ) {
                                // Certificate has expired, set status to archived in the database
                                certificateStoreSession.setArchivedStatus(Admin.getInternalAdmin(), data.getCertificateFingerprint());
                        } else {
                                Date revDate = data.getRevocationDate();
                                if (revDate == null) {
                                        data.setRevocationDate(now);
                                        CertificateData certdata = CertificateData.findByFingerprint(entityManager, data.getCertificateFingerprint());
                                        if (certdata == null) {
                                                throw new FinderException("No certificate with fingerprint " + data.getCertificateFingerprint());
                                        }
                                        // Set revocation date in the database
                                        certdata.setRevocationDate(now);
                                }
                        }
View Full Code Here


                                }
                        // Go through them and create a CRL, at the same time archive expired certificates
                        ArrayList<RevokedCertInfo> certs = new ArrayList<RevokedCertInfo>();
                        Iterator<RevokedCertInfo> iter = revcertinfos.iterator();
                        while (iter.hasNext()) {
                                RevokedCertInfo ci = iter.next();
                                if (ci.getRevocationDate() == null) {
                                        ci.setRevocationDate(new Date());
                                }
                                certs.add(ci);
                        }
                        // create a delta CRL
                        crlBytes = createCRL(admin, ca, certs, baseCrlNumber);
View Full Code Here

      String fingerprint = (String) current[0];
      BigInteger serialNumber = new BigInteger((String)current[1]);
      Date expireDate = new Date(ValueExtractor.extractLongValue(current[2]));
      Date revocationDate = new Date(ValueExtractor.extractLongValue(current[3]));
      int revocationReason = ValueExtractor.extractIntValue(current[4]);
      revokedCertInfos.add(new RevokedCertInfo(fingerprint, serialNumber, revocationDate, revocationReason, expireDate));
    }
      return revokedCertInfos;
  }
View Full Code Here

          crlgen.setIssuerDN(cacert.getSubjectX500Principal());
        }
        if (certs != null) {           
            Iterator<RevokedCertInfo> it = certs.iterator();
            while( it.hasNext() ) {
                RevokedCertInfo certinfo = (RevokedCertInfo)it.next();
                crlgen.addCRLEntry(certinfo.getUserCertificate(), certinfo.getRevocationDate(), certinfo.getReason());
            }
        }

        // Authority key identifier
        if (getUseAuthorityKeyIdentifier() == true) {
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.ca.crl.RevokedCertInfo

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.