Example usage for java.security.cert X509CRLSelector getIssuers

List of usage examples for java.security.cert X509CRLSelector getIssuers

Introduction

In this page you can find the example usage for java.security.cert X509CRLSelector getIssuers.

Prototype

public Collection<X500Principal> getIssuers() 

Source Link

Document

Returns the issuerNames criterion.

Usage

From source file:mitm.common.security.crlstore.dao.X509CRLStoreDAOHibernate.java

private void addSelectorCriterias(X509CRLSelector crlSelector, Criteria criteria) {
    Collection<X500Principal> crlSelectorIssuers = crlSelector.getIssuers();

    if (crlSelectorIssuers != null && crlSelectorIssuers.size() > 0) {
        Disjunction issuerCriteria = Restrictions.disjunction();

        for (X500Principal issuer : crlSelectorIssuers) {
            String issuerCanonical = X500PrincipalInspector.getCanonical(issuer);

            issuerCriteria.add(Restrictions.eq("crl.issuer", issuerCanonical));
        }/*from  w  w  w  . j a  va2s.  c  o m*/

        criteria.add(issuerCriteria);
    }

    Date dateAndTime = crlSelector.getDateAndTime();

    if (dateAndTime != null) {
        criteria.add(Restrictions.lt("crl.thisUpdate", dateAndTime));
        criteria.add(Restrictions.gt("crl.nextUpdate", dateAndTime));
    }
}

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

public Collection<X509CRL> getCRLs(X509CRLSelector selector) {
    Collection<X500Principal> issuers = selector.getIssuers();
    int size = issuers.size();
    Collection<X509CRL> retval = new ArrayList<X509CRL>(size);
    // Yup, this stinks.  There's loss when we convert from principal to
    // string.  Hence, depending on weird encoding effects, we may miss
    // some CRLs.
    Map<String, X509CRL> crlMap = this.crlIssuerDNMap;
    if (crlMap == null)
        return retval;
    for (X500Principal principal : issuers) {
        String dn = principal.getName();
        X509CRL crl = crlMap.get(dn);
        if (crl != null) {
            retval.add(crl);/*from   w  w  w  .  java 2  s  .  c  o  m*/
        }
    }
    return retval;
}