Package java.security.cert

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


        certStream = new FileInputStream(this.certificateLocation);

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

        certs = factory.generateCertificates(certStream);

        this.cachedSamlCertChain = new X509Certificate[certs.size()];

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


      certStream = new FileInputStream(this.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

        certStream = new FileInputStream(this.certificateLocation);

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

        certs = factory.generateCertificates(certStream);

        this.cachedSamlCertChain = new X509Certificate[certs.size()];

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

            try {
                // Uploading certificate using a disk file fails on Windows.  Certificate text is used instead.
                //InputStream is = new FileInputStream(fileName);
                InputStream is = new ByteArrayInputStream(fileName.getBytes());
                CertificateFactory cf = CertificateFactory.getInstance("X.509");
                Collection certs = cf.generateCertificates(is);
                X509Certificate cert = (X509Certificate) certs.iterator().next();
                instance.importTrustCertificate(cert, alias, password);
                String[] update = new String[certificates.length+1];
                System.arraycopy(certificates, 0, update, 0, certificates.length);
                update[certificates.length] = alias;
View Full Code Here

        String certificate = request.getParameter("certificate");
        request.setAttribute("certificate", certificate);
        InputStream is = new ByteArrayInputStream(certificate.getBytes());
        try {
            CertificateFactory cf = CertificateFactory.getInstance("X.509");
            Collection certificates = cf.generateCertificates(is);
            X509Certificate cert = (X509Certificate) certificates.iterator().next();
            request.setAttribute("fingerprint", CertificateUtil.generateFingerprint(cert, "MD5"));
            request.setAttribute("issuer", cert.getIssuerDN().getName());
            request.setAttribute("subject", cert.getSubjectDN().getName());
            request.setAttribute("serial", cert.getSerialNumber());
View Full Code Here

        ensureLoaded(storePassword);
        InputStream is = null;
        try {
            is = new ByteArrayInputStream(certbuf.getBytes());
            CertificateFactory cf = CertificateFactory.getInstance("X.509");
            Collection certcoll = cf.generateCertificates(is);
            Certificate[] chain = new Certificate[certcoll.size()];
            Iterator iter = certcoll.iterator();
            for (int i = 0; iter.hasNext(); i++) {
                chain[i] = (Certificate) iter.next();
            }
View Full Code Here

        String certificate = request.getParameter("certificate");
        request.setAttribute("certificate", certificate);
        InputStream is = new ByteArrayInputStream(certificate.getBytes());
        try {
            CertificateFactory cf = CertificateFactory.getInstance("X.509");
            Collection certificates = cf.generateCertificates(is);
            X509Certificate cert = (X509Certificate) certificates.iterator().next();
            request.setAttribute("fingerprint", CertificateUtil.generateFingerprint(cert, "MD5"));
            request.setAttribute("issuer", cert.getIssuerDN().getName());
            request.setAttribute("subject", cert.getSubjectDN().getName());
            request.setAttribute("serial", cert.getSerialNumber());
View Full Code Here

            try {
                // Uploading certificate using a disk file fails on Windows.  Certificate text is used instead.
                //InputStream is = new FileInputStream(fileName);
                InputStream is = new ByteArrayInputStream(fileName.getBytes());
                CertificateFactory cf = CertificateFactory.getInstance("X.509");
                Collection certs = cf.generateCertificates(is);
                X509Certificate cert = (X509Certificate) certs.iterator().next();
                instance.importTrustCertificate(cert, alias, password);
                String[] update = new String[certificates.length+1];
                System.arraycopy(certificates, 0, update, 0, certificates.length);
                update[certificates.length] = alias;
View Full Code Here

        if (keyStoreProvider.equalsIgnoreCase("Default"))
        {
            keyStoreProvider = new String(System.getProperty("java.security.Provider"));
        }
        CertificateFactory cf = CertificateFactory.getInstance("X.509",keyStoreProvider);
        Collection certcoll = cf.generateCertificates(is);

        Certificate[] chain = new Certificate[certcoll.size()];

        Iterator iter = certcoll.iterator();
        for (int i = 0; iter.hasNext(); i++) {
View Full Code Here

    private static Collection<? extends Certificate>
    loadCertificates(final java.io.InputStream is)
        throws IOException, CertificateException {

        final CertificateFactory factory = CertificateFactory.getInstance("X.509");
        return factory.generateCertificates(is);
    }

    private static char[] deobfuscate(String s) {
        // From the Jetty org.eclipse.jetty.http.security.Password class
        if (!s.startsWith("OBF:")) {
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.