@Override public Set<? extends X509CRLEntry> getRevokedCertificates() { X509CRL crl = this.crl; if (crl != null) { return crl.getRevokedCertificates(); } else { return null; } }
private void initCRL(File file) { try { CertificateFactory certFactory = CertificateFactory.getInstance("X.509"); FileInputStream fis = new FileInputStream(file); X509CRL crl = (X509CRL) certFactory.generateCRL(fis); revocationLists.add(crl); logger.info("CRL initialized from " + file + ": " + (crl.getRevokedCertificates() == null ? "no revoked certificates" : crl.getRevokedCertificates().size() + " certificates revoked")); } catch (Exception e) { logger.warn("Could not read CRL file {: {}", file, e.getMessage()); } }
private void crlEntrySelection() { int row = jtRevokedCerts.getSelectedRow(); if (row != -1) { BigInteger serialNumber = (BigInteger) jtRevokedCerts.getValueAt(row, 0); Set<?> revokedCertsSet = crl.getRevokedCertificates(); X509CRLEntry x509CrlEntry = null; for (Iterator<?> itr = revokedCertsSet.iterator(); itr.hasNext();) { X509CRLEntry entry = (X509CRLEntry) itr.next(); if (serialNumber.equals(entry.getSerialNumber())) { x509CrlEntry = entry; break; } } if (x509CrlEntry.hasExtensions()) { jbCrlEntryExtensions.setEnabled(true); return; } } jbCrlEntryExtensions.setEnabled(false); }
private void displayCrlEntryExtensions() { int row = jtRevokedCerts.getSelectedRow(); if (row != -1) { BigInteger serialNumber = (BigInteger) jtRevokedCerts.getValueAt(row, 0); Set<?> revokedCertsSet = crl.getRevokedCertificates(); X509CRLEntry x509CrlEntry = null; for (Iterator<?> itr = revokedCertsSet.iterator(); itr.hasNext();) { X509CRLEntry entry = (X509CRLEntry) itr.next(); if (serialNumber.equals(entry.getSerialNumber())) { x509CrlEntry = entry; break; } } if (x509CrlEntry.hasExtensions()) { DViewExtensions dViewExtensions = new DViewExtensions(this, res.getString("DViewCrl.EntryExtensions.Title"), x509CrlEntry); dViewExtensions.setLocationRelativeTo(this); dViewExtensions.setVisible(true); } } }
/** * Add the CRLEntry objects contained in a previous CRL. * * @param other the X509CRL to source the other entries from. */ public void addCRL(X509CRL other) throws CRLException { Set revocations = other.getRevokedCertificates(); if (revocations != null) { Iterator it = revocations.iterator(); while (it.hasNext()) { X509CRLEntry entry = (X509CRLEntry)it.next(); ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded()); try { tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject())); } catch (IOException e) { throw new CRLException("exception processing encoding of CRL: " + e.toString()); } } } }
/** * Add the CRLEntry objects contained in a previous CRL. * * @param other the X509CRL to source the other entries from. */ public void addCRL(X509CRL other) throws CRLException { Set revocations = other.getRevokedCertificates(); if (revocations != null) { Iterator it = revocations.iterator(); while (it.hasNext()) { X509CRLEntry entry = (X509CRLEntry)it.next(); ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded()); try { tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject())); } catch (IOException e) { throw new CRLException("exception processing encoding of CRL: " + e.toString()); } } } }
/** * Add the CRLEntry objects contained in a previous CRL. * * @param other the X509CRL to source the other entries from. */ public void addCRL(X509CRL other) throws CRLException { Set revocations = other.getRevokedCertificates(); if (revocations != null) { Iterator it = revocations.iterator(); while (it.hasNext()) { X509CRLEntry entry = (X509CRLEntry)it.next(); ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded()); try { tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject())); } catch (IOException e) { throw new CRLException("exception processing encoding of CRL: " + e.toString()); } } } }
/** * Add the CRLEntry objects contained in a previous CRL. * * @param other the X509CRL to source the other entries from. */ public void addCRL(X509CRL other) throws CRLException { Set revocations = other.getRevokedCertificates(); if (revocations != null) { Iterator it = revocations.iterator(); while (it.hasNext()) { X509CRLEntry entry = (X509CRLEntry)it.next(); ASN1InputStream aIn = new ASN1InputStream(entry.getEncoded()); try { tbsGen.addCRLEntry(ASN1Sequence.getInstance(aIn.readObject())); } catch (IOException e) { throw new CRLException("exception processing encoding of CRL: " + e.toString()); } } } }
Set<? extends X509CRLEntry> revokedCertsSet = crl.getRevokedCertificates(); if (revokedCertsSet == null) { revokedCertsSet = new HashSet<>();
boolean isEmpty = crl.getRevokedCertificates() == null || crl.getRevokedCertificates().isEmpty(); boolean isExpired = crl.getNextUpdate().before(now); if (!isEmpty || options.isProcessEmptyCRLs()) {
boolean isEmpty = crl.getRevokedCertificates() == null || crl.getRevokedCertificates().isEmpty(); boolean isExpired = crl.getNextUpdate().before(now); if (!isEmpty || options.isProcessEmptyCRLs()) {