Package java.security.cert

Examples of java.security.cert.PKIXParameters


    public final void test_setDateLjava_util_Date() throws Exception {
        Set taSet = TestUtils.getTrustAnchorSet();
        assertNotNull("could not create test TrustAnchor set", taSet);

        // test: 'date' is unset and param is null
        PKIXParameters p = new PKIXParameters(taSet);
        p.setDate(null);
        assertNull(p.getDate());

        // test: 'date' is not null
        p = new PKIXParameters(taSet);
        Date toBeSet = new Date(555L);
        p.setDate(toBeSet);
        assertEquals(555L, p.getDate().getTime());
        // modify initial 'date' - it should be copied by constructor
        toBeSet.setTime(0L);
        // check that internal 'date' has not been
        // changed by the above modification
        assertEquals(555L, p.getDate().getTime());
        // set another 'date'
        p.setDate(new Date(333L));
        assertEquals(333L, p.getDate().getTime());
       
        // Regression for HARMONY-2882 (non-bug difference from RI)
        p = new PKIXParameters(taSet);
        p.setDate(new Date(555L));
        p.setDate(null); // reset 'date' back to current time
        assertNull(p.getDate());
    }
View Full Code Here


        Set taSet = TestUtils.getTrustAnchorSet();
        if (taSet == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        }

        PKIXParameters p = new PKIXParameters(taSet);
        assertNotNull("notNull", p.getInitialPolicies());
        assertTrue("isEmpty", p.getInitialPolicies().isEmpty());
    }
View Full Code Here

        Set taSet = TestUtils.getTrustAnchorSet();
        if (taSet == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        }

        PKIXParameters p = new PKIXParameters(taSet);
        Set s = p.getInitialPolicies();
        try {
            // try to modify returned set
            s.add(new Object());
            fail("must be immutable");
        } catch (Exception e) {
View Full Code Here

            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        }

        Set s = new HashSet();
        s.add("1.2.3.4.5.6.7");
        PKIXParameters p = new PKIXParameters(taSet);
        p.setInitialPolicies(s);
        assertEquals(1, p.getInitialPolicies().size());
    }
View Full Code Here

        Set taSet = TestUtils.getTrustAnchorSet();
        if (taSet == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        }

        PKIXParameters p = new PKIXParameters(taSet);
        p.setInitialPolicies(null);
        assertTrue(p.getInitialPolicies().isEmpty());
    }
View Full Code Here

        Set taSet = TestUtils.getTrustAnchorSet();
        if (taSet == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        }

        PKIXParameters p = new PKIXParameters(taSet);
        p.setInitialPolicies(new HashSet());
        assertTrue(p.getInitialPolicies().isEmpty());
    }
View Full Code Here

        }

        Set s = new HashSet();
        s.add("1.2.3.4.5.6.7");
        s.add("1.2.3.4.5.6.8");
        PKIXParameters p = new PKIXParameters(taSet);
        p.setInitialPolicies(s);
        // modify original set
        s.clear();
        // check that set maintained internally has
        // not been changed by the above modification
        assertEquals(2, p.getInitialPolicies().size());
    }
View Full Code Here

        }

        Set s = new HashSet();
        s.add("1.2.3.4.5.6.7");
        s.add(new Object());
        PKIXParameters p = new PKIXParameters(taSet);
        try {
            p.setInitialPolicies(s);
            fail("ClassCastException expected");
        } catch (ClassCastException e) {
        }
    }
View Full Code Here

        Set taSet = TestUtils.getTrustAnchorSet();
        if (taSet == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        }

        PKIXParameters p = new PKIXParameters(taSet);
        assertNotNull("notNull", p.getTrustAnchors());
    }
View Full Code Here

        Set taSet = TestUtils.getTrustAnchorSet();
        if (taSet == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        }

        PKIXParameters p = new PKIXParameters(taSet);
        Set s = p.getTrustAnchors();
        try {
            // try to modify returned set
            s.add(new Object());
            fail("must be immutable");
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of java.security.cert.PKIXParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.