Examples of CertPathBuilderResult


Examples of java.security.cert.CertPathBuilderResult

        if (ta == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor)");
        }

        CertPath cp = new MyCertPath(testEncoding);
        CertPathBuilderResult r =
            new PKIXCertPathBuilderResult(
                    cp,
                    ta,
                    TestUtils.getPolicyTree(),
                    testPublicKey);

        // must return the same reference
        // as passed to the constructor
        assertSame(cp, r.getCertPath());
    }
View Full Code Here

Examples of java.security.cert.CertPathBuilderResult

               NoSuchAlgorithmException {
        TrustAnchor ta = TestUtils.getTrustAnchor();
        if (ta == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor)");
        }
        CertPathBuilderResult r =
            new PKIXCertPathBuilderResult(
                    new MyCertPath(testEncoding),
                    ta,
                    TestUtils.getPolicyTree(),
                    testPublicKey);

        assertNotNull(r.toString());
    }
View Full Code Here

Examples of java.security.cert.CertPathBuilderResult

            {
                System.setProperty("com.sun.security.enableCRLDP","true");
            }
   
            // Build certification path
            CertPathBuilderResult buildResult = CertPathBuilder.getInstance("PKIX").build(pbParams);              
           
            // Validate certification path
            CertPathValidator.getInstance("PKIX").validate(buildResult.getCertPath(),pbParams);
        }
        catch (GeneralSecurityException gse)
        {
            LOG.debug(gse);
            throw new CertificateException("Unable to validate certificate: " + gse.getMessage(), gse);
View Full Code Here

Examples of java.security.cert.CertPathBuilderResult

            {
                System.setProperty("com.sun.security.enableCRLDP","true");
            }
   
            // Build certification path
            CertPathBuilderResult buildResult = CertPathBuilder.getInstance("PKIX").build(pbParams);              
           
            // Validate certification path
            CertPathValidator.getInstance("PKIX").validate(buildResult.getCertPath(),pbParams);
        }
        catch (GeneralSecurityException gse)
        {
            LOG.debug(gse);
            throw new CertificateException("Unable to validate certificate: " + gse.getMessage(), gse);
View Full Code Here

Examples of java.security.cert.CertPathBuilderResult

     */
    public static void build(PKIXBuilderParameters params)
        throws Exception {
        CertPathBuilder builder =
            CertPathBuilder.getInstance("PKIX", "SUN");
        CertPathBuilderResult cpbr = builder.build(params);
    }
View Full Code Here

Examples of java.security.cert.CertPathBuilderResult

     */
    public static void build(PKIXBuilderParameters params)
        throws Exception {
        CertPathBuilder builder =
            CertPathBuilder.getInstance("PKIX");
        CertPathBuilderResult cpbr = builder.build(params);
    }
View Full Code Here

Examples of java.security.cert.CertPathBuilderResult

        // build a valid cerificate path
        CertPathBuilder certPathBuilder = CertPathBuilder.getInstance("PKIX", "SUN");
        PKIXBuilderParameters certPathBuilderParams = new PKIXBuilderParameters(trustAnchors, certSelector);
        certPathBuilderParams.addCertStore(certStore);
        certPathBuilderParams.setRevocationEnabled(false);
        CertPathBuilderResult result = certPathBuilder.build(certPathBuilderParams);

        // get and show cert path
        CertPath certPath = result.getCertPath();
//        System.out.println(certPath.toString());
    }
View Full Code Here

Examples of java.security.cert.CertPathBuilderResult

        Collection selfSignedTAsCerts = trustedSeparated[2];

        String certProvider = (param.getCertProvider() != null) ? param
                .getCertProvider() : param.getProvider();

        CertPathBuilderResult bldResult = buildCertPath(certProvider, newCert,
                selfSignedTAs, trustedCerts);

        // The validation of the certificate path.
        // According to black-box testing, RI keytool doesn't perform
        // the certificate path validation procedure. Therefore this
        // implementation also doesn't validate the certificate chain
        // The path validation procedure can be done in future as an
        // extension of the current functionality.

        // The imported certificate should be included in the chain;
        // The root CA is not included in it.
        X509Certificate[] newChainNoCA = (X509Certificate[]) bldResult
                .getCertPath().getCertificates()
                .toArray(new X509Certificate[0]);

        // get the subject of the root CA which will be the last element of the
        // chain
View Full Code Here

Examples of java.security.cert.CertPathBuilderResult

            throw (NoSuchProviderException) new NoSuchProviderException(
                    "The certProvider " + certProvider
                            + " is not found in the environment.").initCause(e);
        }

        CertPathBuilderResult bldResult = null;
        try {
            // the actual building of the certificate chain is done here
            bldResult = cpBuilder.build(builderParam);
        } catch (CertPathBuilderException e) {
            throw new CertPathBuilderException(strFailed, e);
View Full Code Here

Examples of java.security.cert.CertPathBuilderResult

        Collection selfSignedTAsCerts = trustedSeparated[2];

        String certProvider = (param.getCertProvider() != null) ? param
                .getCertProvider() : param.getProvider();

        CertPathBuilderResult bldResult = buildCertPath(certProvider, newCert,
                selfSignedTAs, trustedCerts);

        // The validation of the certificate path.
        // According to black-box testing, RI keytool doesn't perform
        // the certificate path validation procedure. Therefore this
        // implementation also doesn't validate the certificate chain
        // The path validation procedure can be done in future as an
        // extension of the current functionality.

        // The imported certificate should be included in the chain;
        // The root CA is not included in it.
        X509Certificate[] newChainNoCA = (X509Certificate[]) bldResult
                .getCertPath().getCertificates()
                .toArray(new X509Certificate[0]);

        // get the subject of the root CA which will be the last element of the
        // chain
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.