Examples of PKIXCertPathBuilderResult


Examples of java.security.cert.PKIXCertPathBuilderResult

            X509CertSelector targetConstraints = new X509CertSelector();
            targetConstraints.setSubject(finalCert.getSubjectX500Principal().getEncoded());
            PKIXBuilderParameters params = new PKIXBuilderParameters(trust, targetConstraints);
            params.addCertStore(store);
            params.setDate(validDate.getTime());
            PKIXCertPathBuilderResult result = (PKIXCertPathBuilderResult) cpb.build(params);
            CertPath                  path = result.getCertPath();
           
            if (path.getCertificates().size() != 2)
            {
                return new SimpleTestResult(false, this.getName() + ": wrong number of certs in baseTest path");
            }
View Full Code Here

Examples of java.security.cert.PKIXCertPathBuilderResult

            PKIXBuilderParameters buildParams = new PKIXBuilderParameters(Collections.singleton(new TrustAnchor(rootCert, null)), pathConstraints);
           
            buildParams.addCertStore(store);
            buildParams.setDate(new Date());
           
            PKIXCertPathBuilderResult result = (PKIXCertPathBuilderResult)builder.build(buildParams);
            CertPath                  path = result.getCertPath();
           
            if (path.getCertificates().size() != 2)
            {
                return new SimpleTestResult(false, this.getName() + ": wrong number of certs in v0Test path");
            }
View Full Code Here

Examples of java.security.cert.PKIXCertPathBuilderResult

        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);
        assertTrue(r instanceof PKIXCertPathBuilderResult);
View Full Code Here

Examples of java.security.cert.PKIXCertPathBuilderResult

        TrustAnchor ta = TestUtils.getTrustAnchor();
        if (ta == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor)");
        }
        CertPathBuilderResult r =
            new PKIXCertPathBuilderResult(
                    new MyCertPath(testEncoding),
                    ta,
                    null,
                    testPublicKey);
        assertTrue(r instanceof PKIXCertPathBuilderResult);
View Full Code Here

Examples of java.security.cert.PKIXCertPathBuilderResult

            fail(getName() + ": not performed (could not create test TrustAnchor)");
        }

        try {
            // pass null
            new PKIXCertPathBuilderResult(
                    null,
                    ta,
                    TestUtils.getPolicyTree(),
                    testPublicKey);
            fail("NPE expected");
View Full Code Here

Examples of java.security.cert.PKIXCertPathBuilderResult

     * if trustAnchor is <code>null</code>
     */
    public final void testPKIXCertPathBuilderResult04() {
        try {
            // pass null
            new PKIXCertPathBuilderResult(
                    new MyCertPath(testEncoding),
                    null,
                    TestUtils.getPolicyTree(),
                    testPublicKey);
            fail("NPE expected");
View Full Code Here

Examples of java.security.cert.PKIXCertPathBuilderResult

            fail(getName() + ": not performed (could not create test TrustAnchor)");
        }

        try {
            // pass null
            new PKIXCertPathBuilderResult(
                    new MyCertPath(testEncoding),
                    ta,
                    TestUtils.getPolicyTree(),
                    null);
            fail("NPE expected");
View Full Code Here

Examples of java.security.cert.PKIXCertPathBuilderResult

        // Regression for HARMONY-2786.
        TrustAnchor ta = TestUtils.getTrustAnchor();
        assertNotNull(getName()
                + ": not performed (could not create test TrustAnchor)", ta);

        PKIXCertPathBuilderResult init = new PKIXCertPathBuilderResult(
                new MyCertPath(testEncoding), ta, TestUtils.getPolicyTree(),
                testPublicKey);

        PKIXCertPathBuilderResult clone = (PKIXCertPathBuilderResult) init
                .clone();
        assertSame(init.getCertPath(), clone.getCertPath());
        assertSame(init.getPolicyTree(), clone.getPolicyTree());
        assertSame(init.getPublicKey(), clone.getPublicKey());
        assertSame(init.getTrustAnchor(), clone.getTrustAnchor());
    }
View Full Code Here

Examples of java.security.cert.PKIXCertPathBuilderResult

            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.PKIXCertPathBuilderResult

        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
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.