Code example for PKIXParameters

Methods: addCertPathChecker, getCertPathCheckers

0
        if (taSet == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        } 
 
        // checks that checkers cloned 
        PKIXParameters p = new PKIXParameters(taSet);
        PKIXCertPathChecker cpc = TestUtils.getTestCertPathChecker();
 
        p.addCertPathChecker(cpc);
        // modify checker 
        cpc.init(true);
        // retrieve list and check that CertPathChecker's 
        // state it contains has not been changed by the 
        // above modification 
        List l = p.getCertPathCheckers();
        PKIXCertPathChecker cpc1 = (PKIXCertPathChecker)l.get(0);
        assertEquals("listSize", 1, l.size());
        assertFalse("isCopied", cpc1.isForwardCheckingSupported());
    } 
 
    /**