Package java.security.cert

Examples of java.security.cert.CollectionCertStoreParameters


     * Test #1 for <code>CollectionCertStoreParameters()</code> constructor<br>
     * Assertion: Creates an instance of CollectionCertStoreParameters
     * with the default parameter values (an empty and immutable Collection)
     */
    public final void testCollectionCertStoreParameters01() {
        CertStoreParameters cp = new CollectionCertStoreParameters();
        assertTrue("isCollectionCertStoreParameters",
                cp instanceof CollectionCertStoreParameters);
    }
View Full Code Here


     * Test #2 for <code>CollectionCertStoreParameters</code> constructor<br>
     * Assertion: Creates an instance of CollectionCertStoreParameters
     * with the default parameter values (an empty and immutable Collection)
     */
    public final void testCollectionCertStoreParameters02() {
        CollectionCertStoreParameters cp = new CollectionCertStoreParameters();
        Collection c = cp.getCollection();
        assertTrue("isEmpty", c.isEmpty());

        // check that empty collection is immutable
        try {
            // try to modify it
View Full Code Here

     * Assertion: Creates an instance of CollectionCertStoreParameters
     */
    public final void testCollectionCertStoreParametersCollection01() {
        Vector certificates = new Vector();
        certificates.add(new MyCertificate("TEST", new byte[] {}));
        new CollectionCertStoreParameters(certificates);
    }
View Full Code Here

        // just check that we able to create CollectionCertStoreParameters
        // object passing Collection containing Object which is not
        // a Certificate or CRL
        Vector certificates = new Vector();
        certificates.add(new String("Not a Certificate"));
        new CollectionCertStoreParameters(certificates);
    }
View Full Code Here

     * not modify the contents of the Collection
     */
    public final void testCollectionCertStoreParametersCollection03() {
        Vector certificates = new Vector();
        // create using empty collection
        CollectionCertStoreParameters cp =
            new CollectionCertStoreParameters(certificates);
        // check that the reference is used
        assertTrue("isRefUsed_1", certificates == cp.getCollection());
        // check that collection still empty
        assertTrue("isEmpty", cp.getCollection().isEmpty());
        // modify our collection
        certificates.add(new MyCertificate("TEST", new byte[] {(byte)1}));
        certificates.add(new MyCertificate("TEST", new byte[] {(byte)2}));
        // check that internal state has been changed accordingly
        assertTrue("isRefUsed_2", certificates.equals(cp.getCollection()));
    }
View Full Code Here

     * Assertion: <code>NullPointerException</code> - if
     * <code>collection</code> is <code>null</code>
     */
    public final void testCollectionCertStoreParametersCollection04() {
        try {
            new CollectionCertStoreParameters(null);
            fail("NPE expected");
        } catch (NullPointerException e) {
        }
    }
View Full Code Here

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

        PKIXParameters p = new PKIXParameters(taSet);
        p.addCertStore(CertStore.getInstance("Collection",
                new CollectionCertStoreParameters()));
        assertFalse(p.getCertStores().isEmpty());
    }
View Full Code Here

        if ("PKIX".equalsIgnoreCase(algorithm)) {
            PKIXBuilderParameters xparams =
                new PKIXBuilderParameters(trustStore,
                                          new X509CertSelector());
            Collection crls = getCRLs(crlf);
            CertStoreParameters csp = new CollectionCertStoreParameters(crls);
            CertStore store = CertStore.getInstance("Collection", csp);
            xparams.addCertStore(store);
            xparams.setRevocationEnabled(true);
            String trustLength = (String)attributes.get("trustMaxCertLength");
            if (trustLength != null) {
View Full Code Here

        CertPathParameters params = null;
        if("PKIX".equalsIgnoreCase(algorithm)) {
            PKIXBuilderParameters xparams =
                new PKIXBuilderParameters(trustStore, new X509CertSelector());
            Collection<? extends CRL> crls = getCRLs(crlf);
            CertStoreParameters csp = new CollectionCertStoreParameters(crls);
            CertStore store = CertStore.getInstance("Collection", csp);
            xparams.addCertStore(store);
            xparams.setRevocationEnabled(true);
            String trustLength = endpoint.getTrustMaxCertLength();
            if(trustLength != null) {
View Full Code Here

            list.add(rootCert);
            list.add(interCert);
            list.add(finalCert);
            list.add(rootCrl);
            list.add(interCrl);
            CollectionCertStoreParameters ccsp = new CollectionCertStoreParameters(
                    list);
            CertStore store = CertStore.getInstance("Collection", ccsp, "BC");

            // Searching for rootCert by subjectDN
            X509CertSelector targetConstraints = new X509CertSelector();
View Full Code Here

TOP

Related Classes of java.security.cert.CollectionCertStoreParameters

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.