Examples of PKIXCertPathValidatorResult


Examples of java.security.cert.PKIXCertPathValidatorResult

            intersection = validPolicyTree;
        }
        if ((explicitPolicy > 0) || (intersection != null))
        {
            return new PKIXCertPathValidatorResult(trust, intersection, workingPublicKey);
        }

        throw new CertPathValidatorException("Path processing failed on policy.", null, certPath, index);
    }
View Full Code Here

Examples of java.security.cert.PKIXCertPathValidatorResult

    }

    CertPathBuilder builder = CertPathBuilder.getInstance(PKIXCertificateValidator.CERTPATH_TYPE, BouncyCastleProviderHelper.PROVIDER_NAME);
    PKIXCertPathBuilderResult builderResult = (PKIXCertPathBuilderResult) builder.build(pkixParameters);
    CertPathValidator validator = CertPathValidator.getInstance(PKIXCertificateValidator.CERTPATH_TYPE, BouncyCastleProviderHelper.PROVIDER_NAME);
    PKIXCertPathValidatorResult validatorResult = (PKIXCertPathValidatorResult) validator.validate(builderResult.getCertPath(), pkixParameters);
    return validatorResult;
  }
View Full Code Here

Examples of java.security.cert.PKIXCertPathValidatorResult

                                        CertPath certPath = cf.generateCertPath(Arrays.asList(signingcert));

                                        CertPathValidator certPathValidator = CertPathValidator.getInstance(CertPathValidator.getDefaultType());
                                        CertPathValidatorResult result = certPathValidator.validate(certPath, params);
                                        try {
                                                PKIXCertPathValidatorResult pkixResult = (PKIXCertPathValidatorResult) result;
                                                logger.info("revokation status via CRL PASSED for X509 public key " + signingcert.getSubjectDN().toString());
                                        } catch (Exception ex) {
                                                OutErrorMessage.set("Certificate status is via CRL Failed: " + ex.getMessage() + "." + OutErrorMessage.get());
                                        }
                                }
                                if (map.containsKey(CHECK_TRUST_CHAIN) && Boolean.parseBoolean(map.getProperty(CHECK_TRUST_CHAIN))) {
                                        logger.info("verifying trust chain X509 public key " + signingcert.getSubjectDN().toString());
                                        try {
                                                PKIXParameters params = new PKIXParameters(GetTrustStore());
                                                params.setRevocationEnabled(false);
                                                CertPath certPath = cf.generateCertPath(Arrays.asList(signingcert));

                                                CertPathValidator certPathValidator = CertPathValidator.getInstance(CertPathValidator.getDefaultType());
                                                CertPathValidatorResult result = certPathValidator.validate(certPath, params);

                                                PKIXCertPathValidatorResult pkixResult = (PKIXCertPathValidatorResult) result;

                                                TrustAnchor ta = pkixResult.getTrustAnchor();
                                                X509Certificate cert = ta.getTrustedCert();

                                                logger.info("trust chain validated X509 public key " + signingcert.getSubjectDN().toString());
                                        } catch (Exception ex) {
                                                OutErrorMessage.set("Certificate status Trust validation failed: " + ex.getMessage() + "." + OutErrorMessage.get());
View Full Code Here

Examples of java.security.cert.PKIXCertPathValidatorResult

               NoSuchAlgorithmException {
        TrustAnchor ta = TestUtils.getTrustAnchor();
        if (ta == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor)");
        }
        new PKIXCertPathValidatorResult(
                ta,
                TestUtils.getPolicyTree(),
                testPublicKey);
    }
View Full Code Here

Examples of java.security.cert.PKIXCertPathValidatorResult

     * <code>TrustAnchor</code> parameter is <code>null</code>
     */
    public final void testPKIXCertPathValidatorResult02() {
        try {
            // pass null
            new PKIXCertPathValidatorResult(
                    null,
                    TestUtils.getPolicyTree(),
                    testPublicKey);
            fail("NPE expected");
        } catch (NullPointerException e) {
View Full Code Here

Examples of java.security.cert.PKIXCertPathValidatorResult

        if (ta == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor)");
        }
        try {
            // pass null
            new PKIXCertPathValidatorResult(
                    ta,
                    TestUtils.getPolicyTree(),
                    null);
            fail("NPE expected");
        } catch (NullPointerException e) {
View Full Code Here

Examples of java.security.cert.PKIXCertPathValidatorResult

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

        new PKIXCertPathValidatorResult(
                ta,
                null,
                testPublicKey);
    }
View Full Code Here

Examples of java.security.cert.PKIXCertPathValidatorResult

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

        PKIXCertPathValidatorResult vr =
            new PKIXCertPathValidatorResult(
                    ta,
                    null,
                    testPublicKey);

        // must return the same reference passed
        // as a parameter to the constructor
        assertSame(ta, vr.getTrustAnchor());
    }
View Full Code Here

Examples of java.security.cert.PKIXCertPathValidatorResult

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

        PublicKey pk = testPublicKey;
        PKIXCertPathValidatorResult vr =
            new PKIXCertPathValidatorResult(
                    ta,
                    null,
                    pk);

        // must return the same reference passed
        // as a parameter to the constructor
        assertSame(pk, vr.getPublicKey());
    }
View Full Code Here

Examples of java.security.cert.PKIXCertPathValidatorResult

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

        // valid policy tree case;
        PolicyNode pn = TestUtils.getPolicyTree();
        PKIXCertPathValidatorResult vr =
            new PKIXCertPathValidatorResult(
                    ta,
                    pn,
                    testPublicKey);

        // must return the same reference passed
        // as a parameter to the constructor
        assertSame(pn, vr.getPolicyTree());
    }
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.