Code example for PKIXParameters

Methods: getTrustAnchorssetTrustAnchors

0
        Set taSet = TestUtils.getTrustAnchorSet();
        if (taSet == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        } 
 
        PKIXParameters p = new PKIXParameters(taSet);
        Set s = new HashSet(p.getTrustAnchors());
        s.add(new Object());
        try { 
            p.setTrustAnchors(s);
            fail("ClassCastException expected");
        } catch (ClassCastException e) {
        } 
    } 
 
} 
Connect your IDE to all the code out there  Get Codota for Java