Search in sources :

Example 16 with X509CRLSelector

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

the class X509CRLSelectorTest method test_addIssuerName$B_4.

/**
     * java.security.cert.X509CRLSelector#addIssuerName(byte[])
     */
public void test_addIssuerName$B_4() throws Exception {
    //Regression for HARMONY-465
    X509CRLSelector obj = new X509CRLSelector();
    try {
        obj.addIssuerName((byte[]) null);
        fail("NullPointerException expected");
    } catch (NullPointerException e) {
    // expected
    }
}
Also used : X509CRLSelector(java.security.cert.X509CRLSelector)

Example 17 with X509CRLSelector

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

the class X509CRLSelectorTest method test_addIssuerName$B_3.

/**
     * java.security.cert.X509CRLSelector#addIssuerName(byte[])
     */
public void test_addIssuerName$B_3() throws Exception {
    //Regression for HARMONY-465
    X509CRLSelector obj = new X509CRLSelector();
    try {
        obj.addIssuerName(new byte[] { (byte) 2, (byte) 3, (byte) 4 });
        fail("IOException expected");
    } catch (IOException e) {
    // expected
    }
}
Also used : IOException(java.io.IOException) X509CRLSelector(java.security.cert.X509CRLSelector)

Example 18 with X509CRLSelector

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

the class X509CRLSelectorTest method test_addIssuerLjavax_security_auth_x500_X500Principal01.

/**
     * java.security.cert.X509CRLSelector#addIssuer(javax.security.auth.x500.X500Principal)
     */
public void test_addIssuerLjavax_security_auth_x500_X500Principal01() throws Exception {
    //Regression for HARMONY-465
    X509CRLSelector obj = new X509CRLSelector();
    try {
        obj.addIssuer((X500Principal) null);
        fail("NullPointerException expected");
    } catch (NullPointerException e) {
    // expected
    }
}
Also used : X509CRLSelector(java.security.cert.X509CRLSelector)

Example 19 with X509CRLSelector

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

the class X509CRLSelectorTest method test_addIssuerNameLjava_lang_String01.

/**
     * java.security.cert.X509CRLSelector#addIssuerName(java.lang.String)
     */
public void test_addIssuerNameLjava_lang_String01() throws Exception {
    //Regression for HARMONY-465
    X509CRLSelector obj = new X509CRLSelector();
    try {
        obj.addIssuerName("234");
        fail("IOException expected");
    } catch (IOException e) {
    // expected
    }
    // Regression for HARMONY-1076
    try {
        new X509CRLSelector().addIssuerName("w=y");
        fail("IOException expected");
    } catch (IOException e) {
    // expected
    }
}
Also used : IOException(java.io.IOException) X509CRLSelector(java.security.cert.X509CRLSelector)

Example 20 with X509CRLSelector

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

the class X509CRLSelector2Test method testAddIssuerLjavax_security_auth_x500_X500Principal02.

/**
     * addIssuer(X500Principal issuer) method testing. Tests if CRLs with
     * specified issuers match the selector, and if not specified issuer does
     * not match the selector.
     */
public void testAddIssuerLjavax_security_auth_x500_X500Principal02() {
    X509CRLSelector selector = new X509CRLSelector();
    X500Principal iss1 = new X500Principal("O=First Org.");
    X500Principal iss2 = new X500Principal("O=Second Org.");
    CRL crl1 = new TestCRL(iss1);
    CRL crl2 = new TestCRL(iss2);
    selector.addIssuer(iss1);
    assertTrue("The CRL should match the selection criteria.", selector.match(crl1));
    assertFalse("The CRL should not match the selection criteria.", selector.match(crl2));
    selector.addIssuer(iss2);
    assertTrue("The CRL should match the selection criteria.", selector.match(crl2));
}
Also used : X500Principal(javax.security.auth.x500.X500Principal) X509CRL(java.security.cert.X509CRL) CRL(java.security.cert.CRL) X509CRLSelector(java.security.cert.X509CRLSelector)

Aggregations

X509CRLSelector (java.security.cert.X509CRLSelector)29 X500Principal (javax.security.auth.x500.X500Principal)9 IOException (java.io.IOException)7 BigInteger (java.math.BigInteger)6 Date (java.util.Date)4 AndroidOnly (dalvik.annotation.AndroidOnly)3 X509CRL (java.security.cert.X509CRL)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 CRL (java.security.cert.CRL)2 CertStoreException (java.security.cert.CertStoreException)2 CertificateFactory (java.security.cert.CertificateFactory)2 X509Certificate (java.security.cert.X509Certificate)2 ArrayList (java.util.ArrayList)2 ASN1OctetString (org.apache.harmony.security.asn1.ASN1OctetString)2 InputStream (java.io.InputStream)1 HttpURLConnection (java.net.HttpURLConnection)1 URI (java.net.URI)1 URLConnection (java.net.URLConnection)1 KeyStoreException (java.security.KeyStoreException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1