Package java.security.cert

Examples of java.security.cert.CollectionCertStoreParameters


            p[(i == 0 ? 1 : 0)] = (PKIXParameters)p[i].clone();

            // modify the first object (original or copy)
            p[1].addCertStore(CertStore.getInstance("Collection",
                    new CollectionCertStoreParameters()));
            p[1].addCertPathChecker(TestUtils.getTestCertPathChecker());
            // check that the second object has not been affected by
            // above modification
            assertTrue("certStores["+i+"]",
                    p[0].getCertStores().size() == 1);
View Full Code Here


     */
    public static List getCollectionCertStoresList()
        throws InvalidAlgorithmParameterException,
               NoSuchAlgorithmException {
        CertStore cs = CertStore.getInstance("Collection",
                new CollectionCertStoreParameters());
        ArrayList l = new ArrayList();
        if (!l.add(cs)) {
            throw new RuntimeException("Could not create cert stores list");
        }
        return l;
View Full Code Here

    private boolean initParams() {
        if (!LDAPSupport && !CollectionSupport) {
            fail(NotSupportMsg);
            return false;
        }
        dParams = (CollectionSupport ? (CertStoreParameters)new CollectionCertStoreParameters() :
            (CertStoreParameters)new LDAPCertStoreParameters());
        dType = (CollectionSupport ? CollectionType : defaultType );
        dProv = (CollectionSupport ? defaultProviderCol : defaultProvider );
        dName = (CollectionSupport ? defaultProviderColName : defaultProviderName );
        dValid = (CollectionSupport ? validValuesC : validValues );
View Full Code Here

     * Assertion: Returns a copy of this object
     */
    public final void testClone01() {
        Vector certificates = new Vector();
        certificates.add(new MyCertificate("TEST", new byte[] {(byte)4}));
        CollectionCertStoreParameters cp1 =
            new CollectionCertStoreParameters(certificates);
        CollectionCertStoreParameters cp2 =
            (CollectionCertStoreParameters)cp1.clone();
        // check that that we have new object
        assertTrue(cp1 != cp2);
    }
View Full Code Here

     * is copied, and not the contents
     */
    public final void testClone02() {
        Vector certificates = new Vector();
        certificates.add(new MyCertificate("TEST", new byte[] {(byte)4}));
        CollectionCertStoreParameters cp1 =
            new CollectionCertStoreParameters(certificates);
        CollectionCertStoreParameters cp2 =
            (CollectionCertStoreParameters)cp1.clone();
        // check that both objects hold the same reference
        assertTrue(cp1.getCollection() == cp2.getCollection());
    }
View Full Code Here

     * Test #3 for <code>clone()</code> method<br>
     * Assertion: ...only a reference to the <code>Collection</code>
     * is copied, and not the contents
     */
    public final void testClone03() {
        CollectionCertStoreParameters cp1 =
            new CollectionCertStoreParameters();
        CollectionCertStoreParameters cp2 =
            (CollectionCertStoreParameters)cp1.clone();
        CollectionCertStoreParameters cp3 =
            (CollectionCertStoreParameters)cp2.clone();
        // check that all objects hold the same reference
        assertTrue(cp1.getCollection() == cp2.getCollection() &&
                   cp3.getCollection() == cp2.getCollection());
    }
View Full Code Here

    /**
     * Test #1 for <code>toString()</code> method<br>
     * Assertion: returns the formatted string describing parameters
     */
    public final void testToString01() {
        CollectionCertStoreParameters cp =
            new CollectionCertStoreParameters();
        String s = cp.toString();
        assertNotNull(s);
    }
View Full Code Here

     * Assertion: returns the formatted string describing parameters
     */
    public final void testToString02() {
        Vector certificates = new Vector();
        certificates.add(new MyCertificate("TEST", new byte[] {(byte)4}));
        CollectionCertStoreParameters cp =
            new CollectionCertStoreParameters(certificates);

        assertNotNull(cp.toString());
    }
View Full Code Here

    /**
     * Test #1 for <code>getCollection()</code> method<br>
     * Assertion: returns the Collection (never null)
     */
    public final void testGetCollection01() {
        CollectionCertStoreParameters cp = new CollectionCertStoreParameters();
        assertNotNull(cp.getCollection());
    }
View Full Code Here

     * Test #2 for <code>getCollection()</code> method<br>
     * Assertion: returns the Collection (never null)
     */
    public final void testGetCollection02() {
        Vector certificates = new Vector();
        CollectionCertStoreParameters cp =
            new CollectionCertStoreParameters(certificates);
        assertNotNull(cp.getCollection());
    }
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.