Example usage for org.bouncycastle.jce.provider RFC3280CertPathUtilities ISSUING_DISTRIBUTION_POINT

List of usage examples for org.bouncycastle.jce.provider RFC3280CertPathUtilities ISSUING_DISTRIBUTION_POINT

Introduction

In this page you can find the example usage for org.bouncycastle.jce.provider RFC3280CertPathUtilities ISSUING_DISTRIBUTION_POINT.

Prototype

String ISSUING_DISTRIBUTION_POINT

To view the source code for org.bouncycastle.jce.provider RFC3280CertPathUtilities ISSUING_DISTRIBUTION_POINT.

Click Source Link

Usage

From source file:eu.emi.security.authn.x509.helpers.pkipath.bc.RFC3280CertPathUtilitiesHelper.java

License:Open Source License

protected static ReasonsMask processCRLD2(X509CRL crl, DistributionPoint dp)
        throws SimpleValidationErrorException {
    IssuingDistributionPoint idp = null;
    try {/*from  w ww  .  j a  va 2 s  .  co m*/
        idp = IssuingDistributionPoint.getInstance(CertPathValidatorUtilities.getExtensionValue(crl,
                RFC3280CertPathUtilities.ISSUING_DISTRIBUTION_POINT));
    } catch (Exception e) {
        throw new SimpleValidationErrorException(ValidationErrorCode.distrPtExtError, e);
    }
    // (d) (1)
    if (idp != null && idp.getOnlySomeReasons() != null && dp.getReasons() != null) {
        return new ReasonsMask(dp.getReasons().intValue())
                .intersect(new ReasonsMask(idp.getOnlySomeReasons().intValue()));
    }
    // (d) (4)
    if ((idp == null || idp.getOnlySomeReasons() == null) && dp.getReasons() == null) {
        return ReasonsMask.allReasons;
    }
    // (d) (2) and (d)(3)
    return (dp.getReasons() == null ? ReasonsMask.allReasons : new ReasonsMask(dp.getReasons().intValue()))
            .intersect(idp == null ? ReasonsMask.allReasons
                    : new ReasonsMask(idp.getOnlySomeReasons().intValue()));

}