Package java.security.cert

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


     */
    public void testSerializationSelf() throws Exception {

        CertificateFactory cf = CertificateFactory.getInstance(certType);

        CertPath certPath = cf.generateCertPath(Support_Resources
                .getResourceStream(certPathFileName));

        SerializationTest.verifySelf(certPath);
    }

View Full Code Here


     */
    public void testSerializationCompatibility() throws Exception {

        CertificateFactory cf = CertificateFactory.getInstance(certType);

        CertPath certPath = cf.generateCertPath(Support_Resources
                .getResourceStream(certPathFileName));

        SerializationTest.verifyGolden(this, certPath);
    }

View Full Code Here

                                }
                                try {
                                    CertificateFactory factory = CertificateFactory.getInstance(certificateMatch(valueType));
                                    InputStream certStream = new ByteArrayInputStream(certBytes);
                                    if (X509PKIPATHV1.equals(valueType)) {
                                        CertPath path = factory.generateCertPath(certStream);
                                        for (Certificate certificate : path.getCertificates()) {
                                            credentials.add(new CertificateCredential(certificate));
                                        }
                                    } else if (X509V3.equals(valueType)) {
                                        Certificate certificate = factory.generateCertificate(certStream);
View Full Code Here

                abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, new Base64(76, new byte[]{'\n'}).encodeToString(x509Certificates[0].getEncoded()));
            } else {
                try {
                    CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509", "BC");
                    List<X509Certificate> certificates = Arrays.asList(x509Certificates);
                    abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, new Base64(76, new byte[]{'\n'}).encodeToString(certificateFactory.generateCertPath(certificates).getEncoded()));
                } catch (CertificateException e) {
                    throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
                } catch (NoSuchProviderException e) {
                    throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
                }
View Full Code Here

        List list = new ArrayList();
        for (int i = 1; i < certs.length; i++) {
            list.add(0, getCertFromFile(certs[i]));
        }
        CertificateFactory cf = CertificateFactory.getInstance("X509");
        path = cf.generateCertPath(list);

        anchors = Collections.singleton(anchor);
        params = new PKIXParameters(anchors);
        params.setRevocationEnabled(false);
    }
View Full Code Here

        List list = new ArrayList();
        for (int i = 1; i < certs.length; i++) {
            list.add(0, getCertFromFile(certs[i]));
        }
        CertificateFactory cf = CertificateFactory.getInstance("X509");
        path = cf.generateCertPath(list);

        Set anchors = Collections.singleton(anchor);
        params = new PKIXParameters(anchors);
        params.setRevocationEnabled(false);
        X509CertSelector sel = new X509CertSelector();
View Full Code Here

        List list = new ArrayList();
        for (int i = 1; i < certs.length; i++) {
            list.add(0, getCertFromFile(certs[i]));
        }
        CertificateFactory cf = CertificateFactory.getInstance("X509");
        path = cf.generateCertPath(list);

        Set anchors = Collections.singleton(anchor);
        params = new PKIXParameters(anchors);
        params.setRevocationEnabled(false);
    }
View Full Code Here

        List<X509Certificate> list = new ArrayList<X509Certificate>();
        for (int i = 0; i < fileNames.length; i++) {
            list.add(0, getCertFromFile(relPath + fileNames[i]));
        }
        CertificateFactory cf = CertificateFactory.getInstance("X509");
        return(cf.generateCertPath(list));
    }


    /**
     * Read a bunch of certs from files and create a CertStore from them.
View Full Code Here

            for (int i = 0; i < certificates.length; i++) {
                list.add(certificates[i]);
            }
            CertificateFactory certificateFactory = CertificateFactory
                    .getInstance("X.509");
            certPath = certificateFactory.generateCertPath(list);

            X509Certificate firstCertificate = (X509Certificate) certificates[0];
            principal = new X500Principal(firstCertificate.getSubjectDN()
                    .getName());
View Full Code Here

        throws WSSecurityException {
        InputStream in = new ByteArrayInputStream(data);
        CertPath path = null;
        try {
            CertificateFactory factory = CertificateFactory.getInstance("X.509");
            path = factory.generateCertPath(in);
        } catch (CertificateException e) {
            throw new WSSecurityException(
                WSSecurityException.SECURITY_TOKEN_UNAVAILABLE, "parseError", null, e
            );
        }
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.