Package java.security.cert

Examples of java.security.cert.CertPathValidator.validate()


            if (provider == null || provider.length() == 0) {
                certPathValidator = CertPathValidator.getInstance("PKIX");
            } else {
                certPathValidator = CertPathValidator.getInstance("PKIX", provider);
            }
            certPathValidator.validate(path, param);
        } catch (NoSuchProviderException ex) {
                throw new WSSecurityException(WSSecurityException.FAILURE,
                                "certpath", new Object[] { ex.getMessage() },
                                (Throwable) ex);
        } catch (NoSuchAlgorithmException ex) {
View Full Code Here


      // useful to check for Wave-specific certificate extensions.

      CertificateFactory certFactory = CertificateFactory.getInstance(
          CERTIFICATE_TYPE);
      CertPath certPath = certFactory.generateCertPath(certs);
      validator.validate(certPath, params);
    } catch (GeneralSecurityException e) {
      throw new SignatureException("Certificate validation failure", e);
    }
  }
View Full Code Here

            if (provider == null || provider.length() == 0) {
                validator = CertPathValidator.getInstance("PKIX");
            } else {
                validator = CertPathValidator.getInstance("PKIX", provider);
            }
            validator.validate(path, param);
        } catch (NoSuchProviderException e) {
                throw new WSSecurityException(
                    WSSecurityException.ErrorCode.FAILURE, "certpath", e
                );
        } catch (NoSuchAlgorithmException e) {
View Full Code Here

            }
        }

        // Validate the certificate path.
        CertPathValidator validator = CertPathValidator.getInstance("PKIX");
        validator.validate(path, parameters);

        // Return the certificate path.
        return path;
    }
View Full Code Here

                    pkixParams.addCertStore(CertStore.getInstance("Collection", crlParams));
                }
            }
               
            CertPathValidator validator = CertPathValidator.getInstance("PKIX");
            validator.validate(certPath, pkixParams);
           
        } catch (InvalidAlgorithmParameterException e) {
            LOG.log(Level.WARNING,
                    "Invalid algorithm parameter by certificate chain validation. "
                        + "It is likely that issuer certificates are not found in XKMS trusted storage. "
View Full Code Here

            // Do not check a revocation list
            param.setRevocationEnabled(false);

            // Verify the trust path using the above settings           
            CertPathValidator certPathValidator = CertPathValidator.getInstance("PKIX");
            certPathValidator.validate(path, param);
        } catch (NoSuchAlgorithmException ex) {
            throw new WSSecurityException(WSSecurityException.FAILURE,
                    "certpath",
                    new Object[]{ex.getMessage()},
                    (Throwable) ex);
View Full Code Here

            PKIXParameters param = new PKIXParameters(trust);
            param.addCertStore(store);
            param.setDate(new Date());                 
            param.setRevocationEnabled(false);

            cpv.validate(cp, param);
          }else{
            throw new XKMSResponseSignatureException("Error XKMS request signature doesn't verify.");           
          }
        }catch(Exception e){         
          throw new XKMSResponseSignatureException("Error when verifying signature request.",e);
View Full Code Here

          // Create the validator and validate the path
          CertPathValidator certPathValidator = CertPathValidator.getInstance(CertPathValidator.getDefaultType(), "BC");
          CertificateFactory fact = CertTools.getCertificateFactory();
          CertPath certpath = fact.generateCertPath(calist);

          CertPathValidatorResult result = certPathValidator.validate(certpath, params);

          // Get the certificates validate in the path
          PKIXCertPathValidatorResult pkixResult = (PKIXCertPathValidatorResult)result;
          returnval.addAll(certpath.getCertificates());
View Full Code Here

//                X509CertSelector targetCertConstraints = new X509CertSelector();
//                targetCertConstraints.setKeyUsage(keyUsage)
//                params.setTargetCertConstraints(targetCertConstraints);

        PKIXCertPathValidatorResult result =
            (PKIXCertPathValidatorResult) cpv.validate(certPath, params);
//                PolicyNode policyTree = result.getPolicyTree();
//                PublicKey subjectPublicKey = result.getPublicKey();
        if (LOG.isDebugEnabled()) {
            LOG.debug("Found trust anchor: " + result.getTrustAnchor());
        }
View Full Code Here

              PKIXParameters param = new PKIXParameters(trust);
              param.addCertStore(store);
              param.setDate(new Date());                 
              param.setRevocationEnabled(false);

              cpv.validate(cp, param);

              // Check revocation status
              boolean revoked = certificateStoreSession.isRevoked(CertTools.getIssuerDN(verCert), verCert.getSerialNumber());
              if (revoked) {
                return false;
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.