Package org.apache.harmony.security.provider.cert

Examples of org.apache.harmony.security.provider.cert.X509CertPathImpl


    protected void setUp() throws java.lang.Exception {
        certList = new ArrayList();
        for (int i=0; i<2; i++) {
            certList.add(certificate);
        }
        certPath = new X509CertPathImpl(certList);
    }
View Full Code Here


     * @tests org.apache.harmony.security.provider.cert.X509CertPathImpl.getInstance(InputStream)
     */
    public void test_getInstance_InputStream() throws Exception {
        byte[] encoding = certPath.getEncoded();
        ByteArrayInputStream bais = new ByteArrayInputStream(encoding);
        X509CertPathImpl cpath = X509CertPathImpl.getInstance(bais);
        assertEquals("Certificate list size missmatch", certList.size(), cpath
                .getCertificates().size());
    }
View Full Code Here

    /**
     * @tests org.apache.harmony.security.provider.cert.X509CertPathImpl.getInstance(byte[])
     */
    public void test_getInstance_$B() throws Exception {
        byte[] encoding = certPath.getEncoded();
        X509CertPathImpl cpath = X509CertPathImpl.getInstance(encoding);
        assertEquals("Certificate list size missmatch", certList.size(), cpath
                .getCertificates().size());
    }
View Full Code Here

        CertPath cert_path = factory.generateCertPath(bais);

        encoding = cert_path.getEncoded("PKCS7");

        X509CertPathImpl cpath = X509CertPathImpl
                .getInstance(encoding, "PKCS7");
        assertEquals("Certificate list size missmatch", certList.size(), cpath
                .getCertificates().size());

        bais = new ByteArrayInputStream(encoding);

        cpath = X509CertPathImpl.getInstance(bais, "PKCS7");
        assertEquals("Certificate list size missmatch", certList.size(), cpath
                .getCertificates().size());
    }
View Full Code Here

     * @tests org.apache.harmony.security.provider.cert.X509CertPathImpl.getCertificates()
     */
    public void test_getCertificates() throws Exception {
        try {
            byte[] encoding = certPath.getEncoded();
            X509CertPathImpl cpath = X509CertPathImpl.getInstance(encoding);
            assertEquals("Certificate list size missmatch", certList.size(),
                    cpath.getCertificates().size());
            cpath.getCertificates().remove(0);
            fail("UnsupportedOperationException should be thrown");
        } catch (UnsupportedOperationException e) {
            //pass
        }
    }
View Full Code Here

    protected void setUp() throws java.lang.Exception {
        certList = new ArrayList();
        for (int i=0; i<2; i++) {
            certList.add(certificate);
        }
        certPath = new X509CertPathImpl(certList);
    }
View Full Code Here

     * @tests org.apache.harmony.security.provider.cert.X509CertPathImpl.getInstance(InputStream)
     */
    public void test_getInstance_InputStream() throws Exception {
        byte[] encoding = certPath.getEncoded();
        ByteArrayInputStream bais = new ByteArrayInputStream(encoding);
        X509CertPathImpl cpath = X509CertPathImpl.getInstance(bais);
        assertEquals("Certificate list size missmatch", certList.size(), cpath
                .getCertificates().size());
    }
View Full Code Here

    /**
     * @tests org.apache.harmony.security.provider.cert.X509CertPathImpl.getInstance(byte[])
     */
    public void test_getInstance_$B() throws Exception {
        byte[] encoding = certPath.getEncoded();
        X509CertPathImpl cpath = X509CertPathImpl.getInstance(encoding);
        assertEquals("Certificate list size missmatch", certList.size(), cpath
                .getCertificates().size());
    }
View Full Code Here

        CertPath cert_path = factory.generateCertPath(bais);

        encoding = cert_path.getEncoded("PKCS7");

        X509CertPathImpl cpath = X509CertPathImpl
                .getInstance(encoding, "PKCS7");
        assertEquals("Certificate list size missmatch", certList.size(), cpath
                .getCertificates().size());

        bais = new ByteArrayInputStream(encoding);

        cpath = X509CertPathImpl.getInstance(bais, "PKCS7");
        assertEquals("Certificate list size missmatch", certList.size(), cpath
                .getCertificates().size());
    }
View Full Code Here

     * @tests org.apache.harmony.security.provider.cert.X509CertPathImpl.getCertificates()
     */
    public void test_getCertificates() throws Exception {
        try {
            byte[] encoding = certPath.getEncoded();
            X509CertPathImpl cpath = X509CertPathImpl.getInstance(encoding);
            assertEquals("Certificate list size missmatch", certList.size(),
                    cpath.getCertificates().size());
            cpath.getCertificates().remove(0);
            fail("UnsupportedOperationException should be thrown");
        } catch (UnsupportedOperationException e) {
            //pass
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.security.provider.cert.X509CertPathImpl

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.