/** * Is the certificate revoked? * * @since 0.9.25 */ public static boolean isRevoked(CertStore store, Certificate cert) { try { for (CRL crl : store.getCRLs(null)) { if (crl.isRevoked(cert)) return true; } } catch (GeneralSecurityException gse) {} return false; }
} else if (args[0].equals("loadcrldirs")) { CertStore store = loadCRLs(I2PAppContext.getGlobalContext()); Collection<? extends CRL> crls = store.getCRLs(null); System.out.println("Found " + crls.size() + " CRLs"); } else if (args[0].equals("isrevoked")) {
public static Collection<? extends CRL> getCRLs(final PKIXCRLStoreSelector selector, CertStore certStore) throws CertStoreException { return certStore.getCRLs(new CRLSelector() { public boolean match(CRL crl) { return selector.match(crl); } public Object clone() { return this; } }); } }
/** * Determine whether there are any CRL's in the {@link CertStore} that is to be used. * * @param certStore the cert store that will be used for validation * @return true if the store contains at least 1 CRL instance, false otherwise */ protected boolean storeContainsCRLs(CertStore certStore) { Collection<? extends CRL> crls = null; try { //Save some cycles and memory: Collection cert store allows null as specifier to return all. //crls = certStore.getCRLs( new X509CRLSelector() ); crls = certStore.getCRLs(null); } catch (CertStoreException e) { log.error("Error examining cert store for CRL's, treating as if no CRL's present", e); return false; } if (crls != null && !crls.isEmpty()) { return true; } return false; }
/** * Determine whether there are any CRL's in the {@link CertStore} that is to be used. * * @param certStore the cert store that will be used for validation * @return true if the store contains at least 1 CRL instance, false otherwise */ protected boolean storeContainsCRLs(CertStore certStore) { Collection<? extends CRL> crls = null; try { //Save some cycles and memory: Collection cert store allows null as specifier to return all. //crls = certStore.getCRLs( new X509CRLSelector() ); crls = certStore.getCRLs(null); } catch (CertStoreException e) { log.error("Error examining cert store for CRL's, treating as if no CRL's present", e); return false; } if (crls != null && !crls.isEmpty()) { return true; } return false; }
public static Collection<? extends CRL> getCRLs(final PKIXCRLStoreSelector selector, CertStore certStore) throws CertStoreException { return certStore.getCRLs(new SelectorClone(selector)); }
public static Collection<? extends CRL> getCRLs(final PKIXCRLStoreSelector selector, CertStore certStore) throws CertStoreException { return certStore.getCRLs(new SelectorClone(selector)); }
public Collection engineGetCRLs(CRLSelector crlSelector) throws CertStoreException { boolean searchAllStores = params.getSearchAllStores(); Iterator iter = params.getCertStores().iterator(); List allCRLs = searchAllStores ? new ArrayList() : Collections.EMPTY_LIST; while (iter.hasNext()) { CertStore store = (CertStore)iter.next(); Collection crls = store.getCRLs(crlSelector); if (searchAllStores) { allCRLs.addAll(crls); } else if (!crls.isEmpty()) { return crls; } } return allCRLs; } }
public Collection engineGetCRLs(CRLSelector crlSelector) throws CertStoreException { boolean searchAllStores = params.getSearchAllStores(); Iterator iter = params.getCertStores().iterator(); List allCRLs = searchAllStores ? new ArrayList() : Collections.EMPTY_LIST; while (iter.hasNext()) { CertStore store = (CertStore)iter.next(); Collection crls = store.getCRLs(crlSelector); if (searchAllStores) { allCRLs.addAll(crls); } else if (!crls.isEmpty()) { return crls; } } return allCRLs; } }
public Collection engineGetCRLs(CRLSelector crlSelector) throws CertStoreException { boolean searchAllStores = params.getSearchAllStores(); Iterator iter = params.getCertStores().iterator(); List allCRLs = searchAllStores ? new ArrayList() : Collections.EMPTY_LIST; while (iter.hasNext()) { CertStore store = (CertStore)iter.next(); Collection crls = store.getCRLs(crlSelector); if (searchAllStores) { allCRLs.addAll(crls); } else if (!crls.isEmpty()) { return crls; } } return allCRLs; } }
public Collection engineGetCRLs(CRLSelector crlSelector) throws CertStoreException { boolean searchAllStores = params.getSearchAllStores(); Iterator iter = params.getCertStores().iterator(); List allCRLs = searchAllStores ? new ArrayList() : Collections.EMPTY_LIST; while (iter.hasNext()) { CertStore store = (CertStore)iter.next(); Collection crls = store.getCRLs(crlSelector); if (searchAllStores) { allCRLs.addAll(crls); } else if (!crls.isEmpty()) { return crls; } } return allCRLs; } }
crls.addAll(store.getCRLs(crlSelect)); foundValidStore = true;
crls.addAll(store.getCRLs(crlSelect)); foundValidStore = true;
crls.addAll(store.getCRLs(crlSelect)); foundValidStore = true;
crls.addAll(store.getCRLs(crlSelect)); foundValidStore = true;
crls.addAll(store.getCRLs(crlSelect)); foundValidStore = true;
static List getCRLsFromStore(CertStore certStore) throws CertStoreException, CMSException { List crls = new ArrayList(); try { for (Iterator it = certStore.getCRLs(null).iterator(); it.hasNext();) { X509CRL c = (X509CRL)it.next(); crls.add(CertificateList.getInstance(ASN1Primitive.fromByteArray(c.getEncoded()))); } return crls; } catch (IllegalArgumentException e) { throw new CMSException("error processing crls", e); } catch (IOException e) { throw new CMSException("error processing crls", e); } catch (CRLException e) { throw new CMSException("error encoding crls", e); } }
static List getCRLsFromStore(CertStore certStore) throws CertStoreException, CMSException { List crls = new ArrayList(); try { for (Iterator it = certStore.getCRLs(null).iterator(); it.hasNext();) { X509CRL c = (X509CRL)it.next(); crls.add(CertificateList.getInstance(ASN1Primitive.fromByteArray(c.getEncoded()))); } return crls; } catch (IllegalArgumentException e) { throw new CMSException("error processing crls", e); } catch (IOException e) { throw new CMSException("error processing crls", e); } catch (CRLException e) { throw new CMSException("error encoding crls", e); } }
/** * Retrieves the Certificate Revocation List for the server CA. * * @return the CRL. * @throws IOException if any I/O error occurs. * @throws PKIOperationFailureException if the transaction is rejected. */ public List<X509CRL> getCRL() throws IOException, PKIOperationFailureException { X509Certificate ca = issuerCertificate; if (supportsDistributionPoints(issuerCertificate)) { throw new UnsupportedOperationException(); } final GetCRL req = new GetCRL(ca.getIssuerX500Principal(), ca.getSerialNumber()); performOperation(req); if (getState() == State.CERT_ISSUED) { try { return getCRLs(certStore.getCRLs(null)); } catch (CertStoreException e) { throw new RuntimeException(e); } } else if (getState() == State.CERT_REQ_PENDING) { throw new IllegalStateException(); } else { throw new PKIOperationFailureException(getFailureReason()); } }
Collection<X509CRL> crls = (Collection<X509CRL>) t.getCertStore().getCRLs(null); if (crls.size() == 0) { return null;