Example usage for java.security.cert X509CRL equals

List of usage examples for java.security.cert X509CRL equals

Introduction

In this page you can find the example usage for java.security.cert X509CRL equals.

Prototype

public boolean equals(Object other) 

Source Link

Document

Compares this CRL for equality with the given object.

Usage

From source file:eu.europa.ec.markt.dss.validation.SignedDocumentValidator.java

/**
 * For level -XL, every X509CRL values contained in the ValidationContext must be in the RevocationValues of the
 * signature/*from w w w.j ava2s .c  om*/
 * 
 * @param ctx
 * @param refs
 * @param signingCert
 * @return
 */
protected boolean everyCRLValueOrRefAreThere(ValidationContext ctx, List<?> crlValuesOrRef) {
    for (X509CRL crl : ctx.getNeededCRL()) {
        LOG.info("Looking for CRL ref issued by " + crl.getIssuerX500Principal());
        boolean found = false;

        for (Object valueOrRef : crlValuesOrRef) {
            if (valueOrRef instanceof X509CRL) {
                X509CRL sigCRL = (X509CRL) valueOrRef;
                if (sigCRL.equals(crl)) {
                    found = true;
                    break;
                }
            }
            if (valueOrRef instanceof CRLRef) {
                CRLRef ref = (CRLRef) valueOrRef;
                if (ref.match(crl)) {
                    found = true;
                    break;
                }
            }
        }

        LOG.info("Ref " + (found ? " found" : " not found"));
        if (!found) {
            return false;
        }

    }
    return true;
}