Search in sources :

Example 6 with CRLDistributionPointsExtension

use of sun.security.x509.CRLDistributionPointsExtension in project jdk8u_jdk by JetBrains.

the class Parse method main.

public static void main(String[] args) throws Exception {
    /* Try to parse a CRLDistributionPointsExtension URI with a space. */
    try {
        CRLDistributionPointsExtensionTest(certWithSpaceInCDPStr);
        throw new RuntimeException("Illegally parsed a " + "CRLDistributionPointsExtension uri with a space.");
    } catch (IOException e) {
        System.out.println("Caught the correct exception.");
    }
    /* Try to parse a CRLDistributionPointsExtension URI with backslashes. */
    try {
        CRLDistributionPointsExtensionTest(certWithBackslashesInCDPStr);
        throw new RuntimeException("Illegally parsed a " + "CRLDistributionPointsExtension uri with a backslashes.");
    } catch (IOException e) {
        System.out.println("Caught the correct exception.");
    }
    /* Try to construct a URIName from a uri with a space. */
    String uriWithSpace = "file://crl file.crl";
    URIName name;
    try {
        name = new URIName(uriWithSpace);
        throw new RuntimeException("Illegally created a URIName " + "from a uri with a space.");
    } catch (IOException e) {
        System.out.println("Caught the correct exception.");
    }
    /* Try to construct a URIName from a uri with backslashes. */
    String uriWithBackslashes = "file://\\\\CRL\\crl_file.crl";
    try {
        name = new URIName(uriWithBackslashes);
        throw new RuntimeException("Illegally created a URIName " + "from a uri with backslashes.");
    } catch (IOException e) {
        System.out.println("Caught the correct exception.");
    }
    System.out.println("Tests passed.");
}
Also used : IOException(java.io.IOException) URIName(sun.security.x509.URIName)

Aggregations

IOException (java.io.IOException)5 GeneralSecurityException (java.security.GeneralSecurityException)4 LocalizedIllegalArgumentException (org.forgerock.i18n.LocalizedIllegalArgumentException)4 LdapException (org.forgerock.opendj.ldap.LdapException)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 X509CRL (java.security.cert.X509CRL)3 CRLDistributionPointsExtension (sun.security.x509.CRLDistributionPointsExtension)3 GeneralNames (sun.security.x509.GeneralNames)2 IssuingDistributionPointExtension (com.iplanet.security.x509.IssuingDistributionPointExtension)1 HttpURLConnection (java.net.HttpURLConnection)1 CertificateFactory (java.security.cert.CertificateFactory)1 X509Certificate (java.security.cert.X509Certificate)1 List (java.util.List)1 Connection (org.forgerock.opendj.ldap.Connection)1 SearchResultEntry (org.forgerock.opendj.ldap.responses.SearchResultEntry)1 DerValue (sun.security.util.DerValue)1 DistributionPoint (sun.security.x509.DistributionPoint)1 URIName (sun.security.x509.URIName)1 X509CertImpl (sun.security.x509.X509CertImpl)1