Search in sources :

Example 31 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 32 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 33 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 34 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 35 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)58 X500Principal (javax.security.auth.x500.X500Principal)19 IOException (java.io.IOException)13 BigInteger (java.math.BigInteger)12 Date (java.util.Date)8 X509CRL (java.security.cert.X509CRL)7 X509Certificate (java.security.cert.X509Certificate)5 ByteArrayInputStream (java.io.ByteArrayInputStream)4 CRL (java.security.cert.CRL)4 CertStoreException (java.security.cert.CertStoreException)4 CertificateFactory (java.security.cert.CertificateFactory)4 ArrayList (java.util.ArrayList)4 AndroidOnly (dalvik.annotation.AndroidOnly)3 KeyStoreException (java.security.KeyStoreException)3 URI (java.net.URI)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 UnrecoverableEntryException (java.security.UnrecoverableEntryException)2 UnrecoverableKeyException (java.security.UnrecoverableKeyException)2 CertStore (java.security.cert.CertStore)2 CertificateException (java.security.cert.CertificateException)2