Search in sources :

Example 46 with X509CRL

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

the class X509CRLTest method getTBSCertList.

private void getTBSCertList(CertificateFactory f) throws Exception {
    X509CRL crlRsa = getCRL(f, CRL_RSA);
    byte[] expected = getResourceAsBytes(CRL_RSA_TBS);
    assertEquals(Arrays.toString(expected), Arrays.toString(crlRsa.getTBSCertList()));
}
Also used : X509CRL(java.security.cert.X509CRL)

Example 47 with X509CRL

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

the class X509CRLTest method getCRL.

private final X509CRL getCRL(CertificateFactory f, String name) throws Exception {
    final InputStream is = Support_Resources.getStream(name);
    assertNotNull("File does not exist: " + name, is);
    try {
        X509CRL crl = (X509CRL) f.generateCRL(is);
        assertNotNull(crl);
        return crl;
    } finally {
        try {
            is.close();
        } catch (IOException ignored) {
        }
    }
}
Also used : X509CRL(java.security.cert.X509CRL) DataInputStream(java.io.DataInputStream) InputStream(java.io.InputStream) IOException(java.io.IOException)

Example 48 with X509CRL

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

the class X509CRLTest method getEncoded.

private void getEncoded(CertificateFactory f) throws Exception {
    X509CRL crlRsa = getCRL(f, CRL_RSA);
    byte[] crlRsaBytes = getResourceAsBytes(CRL_RSA);
    assertEquals(Arrays.toString(crlRsaBytes), Arrays.toString(crlRsa.getEncoded()));
}
Also used : X509CRL(java.security.cert.X509CRL)

Example 49 with X509CRL

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

the class X509CRLTest method hasUnsupportedCriticalExtension.

private void hasUnsupportedCriticalExtension(CertificateFactory f) throws Exception {
    X509CRL crlRsa = getCRL(f, CRL_RSA);
    assertFalse(crlRsa.hasUnsupportedCriticalExtension());
    X509CRL unsupportedCrl = getCRL(f, CRL_UNSUPPORTED);
    assertTrue(unsupportedCrl.hasUnsupportedCriticalExtension());
}
Also used : X509CRL(java.security.cert.X509CRL)

Example 50 with X509CRL

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

the class X509CRLTest method getSigAlgOID.

private void getSigAlgOID(CertificateFactory f) throws Exception {
    X509CRL crlRsa = getCRL(f, CRL_RSA);
    assertEquals("1.2.840.113549.1.1.5", crlRsa.getSigAlgOID());
}
Also used : X509CRL(java.security.cert.X509CRL)

Aggregations

X509CRL (java.security.cert.X509CRL)78 IOException (java.io.IOException)24 CRLException (java.security.cert.CRLException)16 X509Certificate (java.security.cert.X509Certificate)15 File (java.io.File)13 CertificateException (java.security.cert.CertificateException)10 CertificateFactory (java.security.cert.CertificateFactory)9 GeneralSecurityException (java.security.GeneralSecurityException)8 CRL (java.security.cert.CRL)7 ArrayList (java.util.ArrayList)7 Iterator (java.util.Iterator)7 ByteArrayInputStream (java.io.ByteArrayInputStream)6 InputStream (java.io.InputStream)6 Calendar (java.util.Calendar)6 HashSet (java.util.HashSet)6 Set (java.util.Set)6 Date (java.util.Date)5 LocalizedIllegalArgumentException (org.forgerock.i18n.LocalizedIllegalArgumentException)5 LdapException (org.forgerock.opendj.ldap.LdapException)5 FileInputStream (java.io.FileInputStream)4