Example usage for java.security.cert CertStore getCRLs

List of usage examples for java.security.cert CertStore getCRLs

Introduction

In this page you can find the example usage for java.security.cert CertStore getCRLs.

Prototype

public final Collection<? extends CRL> getCRLs(CRLSelector selector) throws CertStoreException 

Source Link

Document

Returns a Collection of CRL s that match the specified selector.

Usage

From source file:org.globus.gsi.CertificateRevocationLists.java

public synchronized void reload(String locations) {

    if (locations == null) {
        return;//from   w  w  w .  java 2 s .c o  m
    }

    StringTokenizer tokens = new StringTokenizer(locations, ",");
    Map<String, X509CRL> newCrlIssuerDNMap = new HashMap<String, X509CRL>();

    while (tokens.hasMoreTokens()) {

        try {
            String location = tokens.nextToken().toString().trim();
            CertStore tmp = Stores.getCRLStore("file:" + location + "/*.r*");
            Collection<X509CRL> coll = (Collection<X509CRL>) tmp.getCRLs(new X509CRLSelector());
            for (X509CRL crl : coll) {
                newCrlIssuerDNMap.put(crl.getIssuerX500Principal().getName(), crl);
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    this.crlIssuerDNMap = newCrlIssuerDNMap;
}