Search in sources :

Example 16 with SslCertificate

use of android.net.http.SslCertificate in project android_frameworks_base by ResurrectionRemix.

the class SslCertificateTest method testSslCertificateWithMultipleCN.

@LargeTest
public void testSslCertificateWithMultipleCN() throws Exception {
    X509Certificate x509Certificate = generateCertificate(Issue41662Certificate);
    String dn = x509Certificate.getSubjectDN().getName();
    assertTrue(dn, dn.contains("Posta CA 1"));
    assertTrue(dn, dn.contains("Configuration"));
    SslCertificate sslCertificate = new SslCertificate(x509Certificate);
    assertEquals(dn, "Posta CA 1", sslCertificate.getIssuedTo().getCName());
}
Also used : SslCertificate(android.net.http.SslCertificate) X509Certificate(java.security.cert.X509Certificate) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 17 with SslCertificate

use of android.net.http.SslCertificate in project android_frameworks_base by ResurrectionRemix.

the class SslCertificateTest method testSslCertificateWithEmptyIssuer.

@LargeTest
public void testSslCertificateWithEmptyIssuer() throws Exception {
    X509Certificate x509Certificate = generateCertificate(Issue1597Certificate);
    assertEquals("", x509Certificate.getSubjectDN().getName());
    SslCertificate sslCertificate = new SslCertificate(x509Certificate);
    assertEquals("", sslCertificate.getIssuedBy().getDName());
}
Also used : SslCertificate(android.net.http.SslCertificate) X509Certificate(java.security.cert.X509Certificate) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 18 with SslCertificate

use of android.net.http.SslCertificate in project android_frameworks_base by DirtyUnicorns.

the class SslCertificateTest method testSslCertificateWithMultipleCN.

@LargeTest
public void testSslCertificateWithMultipleCN() throws Exception {
    X509Certificate x509Certificate = generateCertificate(Issue41662Certificate);
    String dn = x509Certificate.getSubjectDN().getName();
    assertTrue(dn, dn.contains("Posta CA 1"));
    assertTrue(dn, dn.contains("Configuration"));
    SslCertificate sslCertificate = new SslCertificate(x509Certificate);
    assertEquals(dn, "Posta CA 1", sslCertificate.getIssuedTo().getCName());
}
Also used : SslCertificate(android.net.http.SslCertificate) X509Certificate(java.security.cert.X509Certificate) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 19 with SslCertificate

use of android.net.http.SslCertificate in project android_frameworks_base by crdroidandroid.

the class SslCertificateTest method testSslCertificateWithEmptyIssuer.

@LargeTest
public void testSslCertificateWithEmptyIssuer() throws Exception {
    X509Certificate x509Certificate = generateCertificate(Issue1597Certificate);
    assertEquals("", x509Certificate.getSubjectDN().getName());
    SslCertificate sslCertificate = new SslCertificate(x509Certificate);
    assertEquals("", sslCertificate.getIssuedBy().getDName());
}
Also used : SslCertificate(android.net.http.SslCertificate) X509Certificate(java.security.cert.X509Certificate) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 20 with SslCertificate

use of android.net.http.SslCertificate in project assertj-android by square.

the class WebViewAssert method hasCertificate.

public WebViewAssert hasCertificate(SslCertificate certificate) {
    isNotNull();
    SslCertificate actualCertificate = actual.getCertificate();
    // 
    assertThat(actualCertificate).overridingErrorMessage("Expected certificate <%s> but was <%s>.", certificate, // 
    actualCertificate).isSameAs(certificate);
    return this;
}
Also used : SslCertificate(android.net.http.SslCertificate)

Aggregations

SslCertificate (android.net.http.SslCertificate)20 X509Certificate (java.security.cert.X509Certificate)18 LargeTest (android.test.suitebuilder.annotation.LargeTest)12 IOException (java.io.IOException)4 SslError (android.net.http.SslError)3 ByteArrayInputStream (java.io.ByteArrayInputStream)3 CertificateFactory (java.security.cert.CertificateFactory)3 NotFoundException (android.content.res.Resources.NotFoundException)2 ParseException (android.net.ParseException)2 X509CertImpl (org.apache.harmony.security.provider.cert.X509CertImpl)2 Context (android.content.Context)1 Bundle (android.os.Bundle)1 ValueCallback (android.webkit.ValueCallback)1 LinearLayout (android.widget.LinearLayout)1 Certificate (java.security.cert.Certificate)1 CertificateException (java.security.cert.CertificateException)1 CalledByNative (org.chromium.base.CalledByNative)1