Examples of generateCertificate()


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

        recip1.setPermission(accessPermission);
        recip2.setPermission(accessPermission2);
       
        InputStream inStream = new FileInputStream(publicCert1);       
        Assert.assertNotNull(cf);
        X509Certificate certificate1 = (X509Certificate)cf.generateCertificate(inStream);
        inStream.close();       
       
        InputStream inStream2 = new FileInputStream(publicCert2);       
        Assert.assertNotNull(cf);
        X509Certificate certificate2 = (X509Certificate)cf.generateCertificate(inStream2);
View Full Code Here

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

        X509Certificate certificate1 = (X509Certificate)cf.generateCertificate(inStream);
        inStream.close();       
       
        InputStream inStream2 = new FileInputStream(publicCert2);       
        Assert.assertNotNull(cf);
        X509Certificate certificate2 = (X509Certificate)cf.generateCertificate(inStream2);
        inStream.close();       
       
        recip1.setX509(certificate1);
        recip2.setX509(certificate2);
       
View Full Code Here

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

    private void protect(PDDocument doc, String certPath) throws Exception
    {
        InputStream inStream = new FileInputStream(certPath);
        CertificateFactory cf = CertificateFactory.getInstance("X.509");
        Assert.assertNotNull(cf);
        X509Certificate certificate = (X509Certificate)cf.generateCertificate(inStream);
        Assert.assertNotNull(certificate);
        inStream.close();       
       
        PublicKeyProtectionPolicy ppp = new PublicKeyProtectionPolicy();               
        PublicKeyRecipient recip = new PublicKeyRecipient();
View Full Code Here

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

                        recip.setPermission(ap);
                       
                       
                        CertificateFactory cf = CertificateFactory.getInstance("X.509");                           
                        InputStream inStream = new FileInputStream(certFile);
                        X509Certificate certificate = (X509Certificate)cf.generateCertificate(inStream);
                        inStream.close();
                       
                        recip.setX509(certificate);
                       
                        ppp.addRecipient(recip);
View Full Code Here

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

      return;

    try {
      CertificateFactory cf = CertificateFactory.getInstance("X.509");
      InputStream is = _clientCert.createInputStream();
      X509Certificate cert = (X509Certificate) cf.generateCertificate(is);
      is.close();

      request.setAttribute("javax.servlet.request.X509Certificate",
                           new X509Certificate[]{cert});
      request.setAttribute(com.caucho.security.AbstractLogin.LOGIN_USER_NAME,
View Full Code Here

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

    if (len > 0 && len < buffer.length) {
      try {
        CertificateFactory cf = CertificateFactory.getInstance("X.509");
        InputStream is = new ByteArrayInputStream(buffer, 0, len);
        cert = (X509Certificate) cf.generateCertificate(is);
        is.close();
      } catch (IOException e) {
        return null;
      }
    }
View Full Code Here

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

        byte inputBytes[] = resource.getBytes();    
        // if the resource stores a raw certificate, we have to handle it
        CertificateFactory certFact =
            CertificateFactory.getInstance(XMLX509Certificate.JCA_CERT_ID);
        X509Certificate cert = (X509Certificate)
            certFact.generateCertificate(new ByteArrayInputStream(inputBytes));
        return cert;
    }

    /**
     * Resolves the input from the given retrieval method
View Full Code Here

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

            for (File currentCert : certs) {
                FileInputStream inStream = new FileInputStream(currentCert);
                BufferedInputStream bis = new BufferedInputStream(inStream);

                CertificateFactory certFactory = CertificateFactory.getInstance("X509");
                Certificate cert = certFactory.generateCertificate(bis);

                trustStore.setCertificateEntry(currentCert.getName(), cert);

                bis.close();
                inStream.close();
View Full Code Here

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

            FileInputStream certInputStream = new FileInputStream(certFile);
            BufferedInputStream certBufferedInputStream = new BufferedInputStream(certInputStream);

            CertificateFactory certFactory = CertificateFactory.getInstance("X509");
            Certificate cert = certFactory.generateCertificate(certBufferedInputStream);

            certBufferedInputStream.close();
            certInputStream.close();

View Full Code Here

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

    }

    private X509Certificate loadCertificate(String fileName) throws Exception {
        FileInputStream fis = new FileInputStream(getControlFilePath(fileName));
        CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
        return (X509Certificate) certFactory.generateCertificate(fis);
    }

    private void markKeyInfoIdAttrs(Document doc) {
        NodeList nl = doc.getElementsByTagNameNS(Constants.SignatureSpecNS, Constants._TAG_KEYINFO);
        for (int i = 0; i < nl.getLength(); i++) {
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.