Examples of MyCertificate


Examples of org.apache.harmony.security.tests.support.cert.MyCertificate

    private void createParams(boolean diffCerts, boolean diffKeys) {
        byte[] encoded = {(byte)0, (byte)1, (byte)2, (byte)3};
        testChain = new Certificate[5];
        for (int i = 0; i < testChain.length; i++) {
            String s = (diffCerts ? Integer.toString(i) : "NEW");
            testChain[i] = new MyCertificate("MY_TEST_CERTIFICATE_"
                    .concat(s), encoded);
        }
        testPrivateKey = (diffKeys ? (PrivateKey)new tmpPrivateKey() :
            (PrivateKey)new tmpPrivateKey(testChain[0].getPublicKey().getAlgorithm()));
    }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.cert.MyCertificate

            keyS.setEntry(alias, null, null);
            fail("NullPointerException must be thrown entry is null");
        } catch (NullPointerException e) {
        }
        KeyStore.TrustedCertificateEntry entry = new KeyStore.TrustedCertificateEntry(
                new MyCertificate("type", new byte[0]));
        try {
            keyS.setEntry(alias, entry, null);
            fail("KeyStoreException must be thrown because this method is not supported");
        } catch (KeyStoreException e) {
        }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.cert.MyCertificate

        try {
            keyS.getCertificate(alias);
            fail(eMsg);
        } catch (KeyStoreException e) {
        }
        MyCertificate mc = new MyCertificate("type", new byte[0]);
        try {
            keyS.getCertificateAlias(mc);
            fail(eMsg);
        } catch (KeyStoreException e) {
        }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.cert.MyCertificate

     * Assertion: ObjectStreamException if a <code>CertPath</code> could not
     * be constructed
     */
    public final void testCertificateRep_readResolve() throws Exception {
        // Create object to be serialized
        Certificate c1 = new MyCertificate("DUMMY", new byte[] {(byte)0, (byte)1});

        // try to serialize/deserialize cert
        try {
            SerializationTest.copySerializable(c1);
            fail("No expected ObjectStreamException");
View Full Code Here

Examples of org.apache.harmony.security.tests.support.cert.MyCertificate

     * ByteArray streams used.
     */
    public final void testWriteReplace() throws Exception
               {
        // Create object to be serialized
        Certificate c1 = new MyCertificate("DUMMY", null);

        // Try to serialize cert
        try {
            SerializationTest.copySerializable(c1);
            fail("No exception");
View Full Code Here

Examples of org.apache.harmony.security.tests.support.cert.MyCertificate

        }
    }

    private static MyCertificate createMC() {
        byte[] enc = { (byte) 0, (byte) 2, (byte) 3, (byte) 4, (byte) 5 };
        return new MyCertificate("Test_Test", enc);
    }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.cert.MyCertificate

            fail(NotSupportMsg);
            return;
        }
        CertificateFactory[] certFs = initCertFs();
        assertNotNull("CertificateFactory objects were not created", certFs);
        MyCertificate mc = createMC();
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(os);
        oos.writeObject(mc);
        oos.flush();
        oos.close();
View Full Code Here

Examples of org.apache.harmony.security.tests.support.cert.MyCertificate

            fail(NotSupportMsg);
            return;
        }
        CertificateFactory[] certFs = initCertFs();
        assertNotNull("CertificateFactory objects were not created", certFs);
        MyCertificate ms = createMC();
        List list = new Vector();
        list.add(ms);
        for (int i = 0; i < certFs.length; i++) {
            try {
                certFs[i].generateCertPath(list);
View Full Code Here

Examples of org.apache.harmony.security.tests.support.cert.MyCertificate

     * constructor<br>
     * 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

Examples of org.apache.harmony.security.tests.support.cert.MyCertificate

        // 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
TOP
Copyright © 2018 www.massapi.com. 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.