Search in sources :

Example 21 with CertPath

use of java.security.cert.CertPath in project robovm by robovm.

the class CertPathTest method testSerializationSelf.

/**
     * serialization/deserialization compatibility.
     */
public void testSerializationSelf() throws Exception {
    TestUtils.initCertPathSSCertChain();
    CertPath certPath = TestUtils.buildCertPathSSCertChain();
    SerializationTest.verifySelf(certPath);
}
Also used : MyCertPath(org.apache.harmony.security.tests.support.cert.MyCertPath) CertPath(java.security.cert.CertPath) MyFailingCertPath(org.apache.harmony.security.tests.support.cert.MyFailingCertPath)

Example 22 with CertPath

use of java.security.cert.CertPath in project robovm by robovm.

the class CertPathTest method testEqualsObject01.

/**
     * Test #1 for <code>equals(Object)</code> method<br>
     * Assertion: object equals to itself
     */
public final void testEqualsObject01() {
    CertPath cp1 = new MyCertPath(testEncoding);
    assertTrue(cp1.equals(cp1));
}
Also used : MyCertPath(org.apache.harmony.security.tests.support.cert.MyCertPath) MyCertPath(org.apache.harmony.security.tests.support.cert.MyCertPath) CertPath(java.security.cert.CertPath) MyFailingCertPath(org.apache.harmony.security.tests.support.cert.MyFailingCertPath)

Example 23 with CertPath

use of java.security.cert.CertPath in project robovm by robovm.

the class CertPathTest method testEqualsObject03.

/**
     * Test for <code>equals(Object)</code> method<br>
     * Assertion: object not equals to <code>null</code>
     */
public final void testEqualsObject03() {
    CertPath cp1 = new MyCertPath(testEncoding);
    assertFalse(cp1.equals(null));
}
Also used : MyCertPath(org.apache.harmony.security.tests.support.cert.MyCertPath) MyCertPath(org.apache.harmony.security.tests.support.cert.MyCertPath) CertPath(java.security.cert.CertPath) MyFailingCertPath(org.apache.harmony.security.tests.support.cert.MyFailingCertPath)

Example 24 with CertPath

use of java.security.cert.CertPath in project robovm by robovm.

the class CertPathTest method testToString.

/**
     * Test for <code>toString()</code> method<br>
     * Assertion: returns string representation of
     * <code>CertPath</code> object
     */
public final void testToString() {
    CertPath cp1 = new MyCertPath(testEncoding);
    assertNotNull(cp1.toString());
}
Also used : MyCertPath(org.apache.harmony.security.tests.support.cert.MyCertPath) MyCertPath(org.apache.harmony.security.tests.support.cert.MyCertPath) CertPath(java.security.cert.CertPath) MyFailingCertPath(org.apache.harmony.security.tests.support.cert.MyFailingCertPath)

Example 25 with CertPath

use of java.security.cert.CertPath in project robovm by robovm.

the class myCertPathBuilder method testBuild.

// Test passed on RI
@KnownFailure(value = "expired certificate bug 2322662")
public void testBuild() throws Exception {
    TestUtils.initCertPathSSCertChain();
    CertPathParameters params = TestUtils.getCertPathParameters();
    CertPathBuilder builder = TestUtils.getCertPathBuilder();
    try {
        CertPathBuilderResult result = builder.build(params);
        assertNotNull("builder result is null", result);
        CertPath certPath = result.getCertPath();
        assertNotNull("certpath of builder result is null", certPath);
    } catch (InvalidAlgorithmParameterException e) {
        fail("unexpected Exception: " + e);
    }
}
Also used : InvalidAlgorithmParameterException(java.security.InvalidAlgorithmParameterException) CertPathBuilderResult(java.security.cert.CertPathBuilderResult) CertPathParameters(java.security.cert.CertPathParameters) CertPathBuilder(java.security.cert.CertPathBuilder) CertPath(java.security.cert.CertPath) KnownFailure(dalvik.annotation.KnownFailure)

Aggregations

CertPath (java.security.cert.CertPath)55 X509Certificate (java.security.cert.X509Certificate)17 MyCertPath (org.apache.harmony.security.tests.support.cert.MyCertPath)16 CertificateFactory (java.security.cert.CertificateFactory)15 MyFailingCertPath (org.apache.harmony.security.tests.support.cert.MyFailingCertPath)14 CertPathValidatorException (java.security.cert.CertPathValidatorException)13 ArrayList (java.util.ArrayList)10 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)9 CertPathValidator (java.security.cert.CertPathValidator)9 CertPathBuilderResult (java.security.cert.CertPathBuilderResult)8 TrustAnchor (java.security.cert.TrustAnchor)8 ByteArrayInputStream (java.io.ByteArrayInputStream)7 Certificate (java.security.cert.Certificate)7 PKIXCertPathValidatorResult (java.security.cert.PKIXCertPathValidatorResult)7 PKIXParameters (java.security.cert.PKIXParameters)7 HashSet (java.util.HashSet)7 CertPathBuilder (java.security.cert.CertPathBuilder)6 CertPathBuilderException (java.security.cert.CertPathBuilderException)6 CertificateException (java.security.cert.CertificateException)6 PKIXBuilderParameters (java.security.cert.PKIXBuilderParameters)6