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

    /**
     * Test for <code>hashCode()</code> method<br>
     * Assertion: returns hash of the <code>Certificate</code> instance
     */
    public final void testHashCode() {
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        Certificate c2 = new MyCertificate("TEST_TYPE", testEncoding);

        assertTrue(c1.hashCode() == c2.hashCode());
    }
View Full Code Here

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

    /**
     * Test for <code>hashCode()</code> method<br>
     * Assertion: hash code of equal objects should be the same
     */
    public final void testHashCodeEqualsObject() {
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        Certificate c2 = new MyCertificate("TEST_TYPE", testEncoding);

        assertTrue((c1.hashCode() == c2.hashCode()) && c1.equals(c2));
    }
View Full Code Here

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

    /**
     * Test for <code>getType()</code> method<br>
     * Assertion: returns this certificate type
     */
    public final void testGetType() {
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        assertEquals("TEST_TYPE", c1.getType());
    }
View Full Code Here

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

    /**
     * Test #1 for <code>equals(Object)</code> method<br>
     * Assertion: object equals to itself
     */
    public final void testEqualsObject01() {
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        assertTrue(c1.equals(c1));
    }
View Full Code Here

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

     * Test for <code>equals(Object)</code> method<br>
     * Assertion: object equals to other <code>Certificate</code>
     * instance with the same state
     */
    public final void testEqualsObject02() {
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        Certificate c2 = new MyCertificate("TEST_TYPE", testEncoding);
        assertTrue(c1.equals(c2) && c2.equals(c1));
    }
View Full Code Here

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

    /**
     * Test for <code>equals(Object)</code> method<br>
     * Assertion: object not equals to <code>null</code>
     */
    public final void testEqualsObject03() {
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        assertFalse(c1.equals(null));
    }
View Full Code Here

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

     * Test for <code>equals(Object)</code> method<br>
     * Assertion: object not equals to other which is not
     * instance of <code>Certificate</code>
     */
    public final void testEqualsObject04() {
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        assertFalse(c1.equals("TEST_TYPE"));
    }
View Full Code Here

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

    /**
     * This test just calls <code>getEncoded()</code> method<br>
     * @throws CertificateEncodingException
     */
    public final void testGetEncoded() throws CertificateEncodingException {
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        c1.getEncoded();
    }
View Full Code Here

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

        throws InvalidKeyException,
               CertificateException,
               NoSuchAlgorithmException,
               NoSuchProviderException,
               SignatureException {
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        c1.verify(null);
    }
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.