Package java.security.cert

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


        // load the cert chain
        CertificateFactory cf = CertificateFactory.getInstance("X.509");
        ByteArrayInputStream bais = new ByteArrayInputStream(certChain);

        Collection certCol = cf.generateCertificates(bais);
        Certificate[] certs = new Certificate[certCol.toArray().length];
        if (certCol.size() == 1) {
            Debug.log("Single certificate; no chain", module);
            bais = new ByteArrayInputStream(certChain);
            Certificate cert = cf.generateCertificate(bais);
View Full Code Here


            // loading CertificateChain
            CertificateFactory cf = CertificateFactory.getInstance("X.509");
            InputStream certstream = fullStream (certfile);

            Collection c = cf.generateCertificates(certstream) ;
            Certificate[] certs = new Certificate[c.toArray().length];

            if (c.size() == 1) {
                certstream = fullStream (certfile);
                System.out.println("One certificate, no chain.");
View Full Code Here

            // loading CertificateChain
            CertificateFactory cf = CertificateFactory.getInstance("X.509");
            InputStream certstream = fullStream(certfile);

            Collection c = cf.generateCertificates(certstream);
            Certificate[] certs = new Certificate[c.toArray().length];

            if (c.size() == 1) {
                certstream = fullStream(certfile);
                System.out.println("One certificate, no chain.");
View Full Code Here

            // loading CertificateChain
            CertificateFactory cf = CertificateFactory.getInstance("X.509");
            InputStream certstream = fullStream(certFile);

            Collection c = cf.generateCertificates(certstream);
            Certificate[] certs = new Certificate[c.toArray().length];

            if (c.size() == 1) {
                certstream = fullStream(certFile);
                Certificate cert = cf.generateCertificate(certstream);
View Full Code Here

  @SuppressWarnings("unchecked")
  public Exception addX509CertFile(final String aPath) {
    try {
      final CertificateFactory tmpCertFac = CertificateFactory.getInstance(Constants.CERT_TYPE_X509); // X.509
                                                      // ?
      final Collection<X509Certificate> tmpCertCol = (Collection<X509Certificate>) tmpCertFac
          .generateCertificates(new FileInputStream(aPath));
      for (X509Certificate tmpCert : tmpCertCol) {
        kall.setCertificateEntry(tmpCert.getSerialNumber().toString(Character.MAX_RADIX), tmpCert);
      }
    } catch (Exception e) {
View Full Code Here

            certStream = new FileInputStream(certificateLocation);

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

            certs = factory.generateCertificates(certStream);

            X509Certificate[] certChain = new X509Certificate[certs.size()];

            Iterator certIter = certs.iterator();
View Full Code Here

        Collection oCertColl = null;
        try
        {
            oCertStream = new FileInputStream(sCertsFile);
            CertificateFactory oCF = CertificateFactory.getInstance("X.509");
            oCertColl = oCF.generateCertificates(oCertStream);
            X509Certificate[] oChain = new X509Certificate[oCertColl.size()];
            Iterator oCertIt = oCertColl.iterator();
            int nCert = 0;
            while (oCertIt.hasNext())
            {
View Full Code Here

    Collection oCertColl = null;
    try
    {
      oCertStream = new FileInputStream(sCertsFile);
      CertificateFactory oCF = CertificateFactory.getInstance("X.509");
      oCertColl = oCF.generateCertificates(oCertStream);
      X509Certificate[] oChain = new X509Certificate[oCertColl.size()];
      Iterator oCertIt = oCertColl.iterator();
      int nCert = 0;
      while (oCertIt.hasNext())
      {
View Full Code Here

      certStream = new FileInputStream(certificateLocation);

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

      certs = factory.generateCertificates(certStream);

      X509Certificate[] certChain = new X509Certificate[certs.size()];

      Iterator certIter = certs.iterator();
View Full Code Here

        Collection oCertColl = null;
        try
        {
            oCertStream = new FileInputStream(sCertsFile);
            CertificateFactory oCF = CertificateFactory.getInstance("X.509");
            oCertColl = oCF.generateCertificates(oCertStream);
            X509Certificate[] oChain = new X509Certificate[oCertColl.size()];
            Iterator oCertIt = oCertColl.iterator();
            int nCert = 0;
            while (oCertIt.hasNext())
            {
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.