Package java.security.cert

Examples of java.security.cert.CertificateFactory.generateCRL()


            // initialise CertStore
        X509Certificate rootCert = (X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.rootCertBin));
        X509Certificate interCert = (X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.interCertBin));
        X509Certificate finalCert = (X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.finalCertBin));
        X509CRL rootCrl = (X509CRL)cf.generateCRL(new ByteArrayInputStream(CertPathTest.rootCrlBin));
        X509CRL interCrl = (X509CRL)cf.generateCRL(new ByteArrayInputStream(CertPathTest.interCrlBin));
        List list = new ArrayList();
        list.add(rootCert);
        list.add(interCert);
        list.add(finalCert);
View Full Code Here


            // initialise CertStore
        X509Certificate rootCert = (X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.rootCertBin));
        X509Certificate interCert = (X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.interCertBin));
        X509Certificate finalCert = (X509Certificate)cf.generateCertificate(new ByteArrayInputStream(CertPathTest.finalCertBin));
        X509CRL rootCrl = (X509CRL)cf.generateCRL(new ByteArrayInputStream(CertPathTest.rootCrlBin));
        X509CRL interCrl = (X509CRL)cf.generateCRL(new ByteArrayInputStream(CertPathTest.interCrlBin));
        List list = new ArrayList();
        list.add(rootCert);
        list.add(interCert);
        list.add(finalCert);
        list.add(rootCrl);
View Full Code Here

                    .generateCertificate(new ByteArrayInputStream(
                            CertPathTest.interCertBin));
            X509Certificate finalCert = (X509Certificate)cf
                    .generateCertificate(new ByteArrayInputStream(
                            CertPathTest.finalCertBin));
            X509CRL rootCrl = (X509CRL)cf.generateCRL(new ByteArrayInputStream(
                    CertPathTest.rootCrlBin));
            X509CRL interCrl = (X509CRL)cf
                    .generateCRL(new ByteArrayInputStream(
                            CertPathTest.interCrlBin));
View Full Code Here

        {
            bIn = new ByteArrayInputStream(bytes);

            CertificateFactory  fact = CertificateFactory.getInstance("X.509", "BC");

            CRL cert = fact.generateCRL(bIn);

            // System.out.println(cert);
        }
        catch (Exception e)
        {
View Full Code Here

        CertificateFactory factory = CertificateFactory.getInstance("X.509");

        ByteArrayInputStream bais = new ByteArrayInputStream(
                Base64.decode(pkcs7so.getBytes()));
        try {
            factory.generateCRL(bais);
            fail("Expected exception was not thrown");
        } catch (Exception e) { }
        bais = new ByteArrayInputStream(Base64.decode(pkcs7so.getBytes()));
        try {
            factory.generateCertificate(bais);
View Full Code Here

       
        for (int i=0; i<good.length; i++) {
            bais = new ByteArrayInputStream(
                    (good[i][0] + x509crl + good[i][1]).getBytes());

            X509CRL crl = (X509CRL) factory.generateCRL(bais);
            assertNotNull("Factory returned null on correct data", crl);

            if (publicKey != null) {
                // verify the signatures
                crl.verify(publicKey);
View Full Code Here

        for (int i=0; i<bad_content.length; i++) {
            bais = new ByteArrayInputStream(
                    (good[0][0] + bad_content[i] + good[0][1]).getBytes());
            try {
                factory.generateCRL(bais);
                fail("Expected exception was not thrown");
            } catch (Exception e) {
                // e.printStackTrace();
            }
        }
View Full Code Here

        for (int i=0; i<bad.length; i++) {
            bais = new ByteArrayInputStream(
                    (bad[i][0] + x509crl + bad[i][1]).getBytes());
            try {
                factory.generateCRL(bais);
                fail("Expected exception was not thrown");
            } catch (Exception e) { }
        }
    }
View Full Code Here

        CertificateFactory fact = CertificateFactory.getInstance("X.509");
        for (int i = 0; i < CRL_URLS.length; i++) {
            URL certUrl = new URL(BASE_URL + CRL_URLS[i]);
            try {
                InputStream is = certUrl.openStream();
                CRL crl = fact.generateCRL(is);
                assertNotNull("The CRL in \"" + certUrl.toExternalForm()
                        + "\" were not parsed correctly", crl);
            } catch (IOException e) {
                // the certificate could not be found, skip it
            } catch (CRLException e) {
View Full Code Here

  String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
  FileInputStream fis = new FileInputStream(
      base + fs + "data" + fs + "ie" + fs +
       "baltimore" + fs + "merlin-examples" + fs +
       "merlin-xmldsig-twenty-three" + fs + "certs" + fs + "crl");
  X509CRL crl = (X509CRL) cf.generateCRL(fis);
  fis.close();
  xds.add(crl);
  KeyInfo crt_crl = kifac.newKeyInfo(Collections.singletonList
            (kifac.newX509Data(xds)));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.