Package org.apache.harmony.security.tests.support.cert

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


        } catch (NullPointerException e) {
        }

        try {
            ksSpi.engineSetEntry("", new KeyStore.TrustedCertificateEntry(
                    new MyCertificate("type", new byte[0])), null);
            fail("KeyStoreException must be thrown");
        } catch (KeyStoreException e) {           
        }

        try {
View Full Code Here


        }
    }

    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

            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

            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

     * 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

     * 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

            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

        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

TOP

Related Classes of org.apache.harmony.security.tests.support.cert.MyCertificate

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.