Package java.security.cert

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


        PdfArray crlArray = dictionary.getAsArray(PdfName.CRLS);
        ArrayList<X509CRL> crls = new ArrayList<X509CRL>();
        if (crlArray != null) {
            for (int i = 0; i < crlArray.size(); i++) {
                PRStream stream = (PRStream) crlArray.getAsStream(i);
                X509CRL crl = (X509CRL) factory.generateCRL(new ByteArrayInputStream(PdfReader.getStreamBytes(stream)));
                crls.add(crl);
            }
        }
        if (ocsps.size() == 0 && crls.size() == 0) {
            throw new NoRevocationStatusException(messages.getString(
View Full Code Here


     */
    public static java.security.cert.X509CRL buildJavaX509CRL(String base64CRL)
            throws CertificateException, CRLException {
        CertificateFactory  cf = CertificateFactory.getInstance("X.509");
        ByteArrayInputStream input = new ByteArrayInputStream(Base64.decode(base64CRL));
        return (java.security.cert.X509CRL) cf.generateCRL(input);
    }
   
    /**
     * Build Java DSA public key from base64 encoding.
     *
 
View Full Code Here

                SearchResult sr = answer.next();
                Attributes attrs = sr.getAttributes();
                Attribute attribute = attrs.get(tmpAttrName);
                if (attribute != null) {
                    CertificateFactory cf = CertificateFactory.getInstance("X.509");
                    X509CRL crl = (X509CRL) cf.generateCRL(new ByteArrayInputStream(
                            (byte[]) attribute.get()));
                    crls.add(crl);
                }
            }
            return crls;
View Full Code Here

        try {
            crls = new ArrayList<CRL>();
            for (int k = 0; k < seq.size(); ++k) {
                ByteArrayInputStream ar = new ByteArrayInputStream(seq.getObjectAt(k).toASN1Primitive().getEncoded(ASN1Encoding.DER));
                CertificateFactory cf = CertificateFactory.getInstance("X.509");
                X509CRL crl = (X509CRL)cf.generateCRL(ar);
                crls.add(crl);
            }
        }
        catch (Exception ex) {
            // ignore
View Full Code Here

  public static CRL getCRL(String url) throws IOException, CertificateException, CRLException {
    if (url == null)
      return null;
    InputStream is = new URL(url).openStream();
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    return (CRL)cf.generateCRL(is);
  }

  // Online Certificate Status Protocol

  /**
 
View Full Code Here

      if (crlurl == null)
        return null;
      LOGGER.info("Getting CRL from " + crlurl);
      CertificateFactory cf = CertificateFactory.getInstance("X.509");
      // Creates the CRL
      return (X509CRL) cf.generateCRL(new URL(crlurl).openStream());
    }
    catch(IOException e) {
      return null;
    }
    catch(GeneralSecurityException e) {
View Full Code Here

    if (crlarray == null)
      return crls;
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    for (int i = 0; i < crlarray.size(); i++) {
      PRStream stream = (PRStream) crlarray.getAsStream(i);
      X509CRL crl = (X509CRL)cf.generateCRL(new ByteArrayInputStream(PdfReader.getStreamBytes(stream)));
      crls.add(crl);
    }
    return crls;
  }
 
View Full Code Here

        log.trace(">getIssuerDN(crl)");
      }*/
        String dn = null;
        try {
            CertificateFactory cf = CertTools.getCertificateFactory();
            X509CRL x509crl = (X509CRL) cf.generateCRL(new ByteArrayInputStream(crl.getEncoded()));
            //log.debug("Created certificate of class: " + x509crl.getClass().getName());
            dn = x509crl.getIssuerDN().toString();
        } catch (CRLException ce) {
            log.error("CRLException: ", ce);
            return null;
View Full Code Here

     */
    public static X509CRL getCRLfromByteArray(byte[] crl)
        throws CRLException {
        log.trace(">getCRLfromByteArray");
        CertificateFactory cf = CertTools.getCertificateFactory();
        X509CRL x509crl = (X509CRL) cf.generateCRL(new ByteArrayInputStream(crl));
        log.trace("<getCRLfromByteArray");

        return x509crl;
    } // getCRLfromByteArray

View Full Code Here

        try {
            crls = new ArrayList<CRL>();
            for (int k = 0; k < seq.size(); ++k) {
                ByteArrayInputStream ar = new ByteArrayInputStream(seq.getObjectAt(k).getDERObject().getDEREncoded());
                CertificateFactory cf = CertificateFactory.getInstance("X.509");
                X509CRL crl = (X509CRL)cf.generateCRL(ar);
                crls.add(crl);
            }
        }
        catch (Exception ex) {
            // ignore
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.