Example usage for org.bouncycastle.x509 CertPathReviewerException CertPathReviewerException

List of usage examples for org.bouncycastle.x509 CertPathReviewerException CertPathReviewerException

Introduction

In this page you can find the example usage for org.bouncycastle.x509 CertPathReviewerException CertPathReviewerException.

Prototype

public CertPathReviewerException(ErrorBundle errorMessage) 

Source Link

Usage

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

License:Open Source License

/** 
 * Initializes the PKIXCertPathReviewer with the given {@link CertPath} and {@link PKIXParameters} params
 * @param certPath the {@link CertPath} to validate
 * @param params the {@link PKIXParameters} to use
 * @throws CertPathReviewerException if the certPath is empty
 * @throws IllegalStateException if the {@link PKIXCertPathReviewer} is already initialized
 *///from  w w w. j  a va 2 s  .  com
public void init(CertPath certPath, ExtPKIXParameters params) throws CertPathReviewerException {
    if (initialized) {
        throw new IllegalStateException("object is already initialized!");
    }
    initialized = true;

    // check input parameters
    if (certPath == null) {
        throw new NullPointerException("certPath was null");
    }
    this.certPath = certPath;

    certs = certPath.getCertificates();
    n = certs.size();
    if (certs.isEmpty()) {
        throw new CertPathReviewerException(new ErrorBundle(RESOURCE_NAME, "CertPathReviewer.emptyCertPath"));
    }

    pkixParams = params.clone();

    // 6.1.1 - Inputs

    // a) done

    // b)

    validDate = getValidDate(pkixParams);

    // c) part of pkixParams

    // d) done at the beginning of checkSignatures

    // e) f) g) part of pkixParams

    // initialize output parameters

    notifications = null;
    errors = null;
    trustAnchor = null;
    subjectPublicKey = null;
    policyTree = null;
}