Package java.security.cert

Examples of java.security.cert.PKIXParameters


      
       Set trust = new HashSet();
       trust.add(new TrustAnchor(rootCert, null));
      
       CertPathValidator cpv = CertPathValidator.getInstance("PKIX","BC");
       PKIXParameters param = new PKIXParameters(trust);
       param.addCertStore(store);
       param.setDate(new Date());
       if(trustedCRLs == null){
         param.setRevocationEnabled(false);
       }else{
         param.setRevocationEnabled(true);
       }
       cpv.validate(cp, param);
       retval = true;
     }catch(Exception e){
       log.error(intres.getLocalizedMessage("xkms.errorverifyingcert"),e);     
View Full Code Here


         
          Set trust = new HashSet();
          trust.add(new TrustAnchor(rootCert, null));
         
          CertPathValidator cpv = CertPathValidator.getInstance("PKIX","BC");
          PKIXParameters param = new PKIXParameters(trust);
          param.addCertStore(store);
          param.setDate(date);
          if(trustedCRLs == null){
            param.setRevocationEnabled(false);
          }else{
            param.setRevocationEnabled(true);
          }
          cpv.validate(cp, param);
          retval = new ParsedSignatureResult(verifies, usercert,content);
        }catch(Exception e){
      log.error("Error verifying data : ", e);
View Full Code Here

            List certList = Arrays.asList(certs);
            CertificateFactory factory = CertificateFactory.getInstance("X.509");
            CertPath path = factory.generateCertPath(certList);

            // Use the certificates in the keystore as TrustAnchors
            PKIXParameters param = new PKIXParameters(this.keystore);

            // 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) {
View Full Code Here

                TrustAnchor anchor =
                    new TrustAnchor(cert, cert.getExtensionValue(NAME_CONSTRAINTS_OID));
                set.add(anchor);
            }

            PKIXParameters param = new PKIXParameters(set);

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

            // Verify the trust path using the above settings
            String provider =
                properties.getProperty("org.apache.ws.security.crypto.merlin.cert.provider");
            CertPathValidator certPathValidator;
View Full Code Here

                        set.add(anchor);
                    }
                }
            }

            PKIXParameters param = new PKIXParameters(set);
            param.setRevocationEnabled(enableRevocation);
            if (enableRevocation && crlCertStore != null) {
                param.addCertStore(crlCertStore);
            }

            // Verify the trust path using the above settings
            String provider = getCryptoProvider();
            CertPathValidator validator = null;
View Full Code Here

                TrustAnchor anchor = new TrustAnchor(cert, cert
                        .getExtensionValue("NameConstraints"));
                set.add(anchor);
            }

            PKIXParameters param = new PKIXParameters(set);

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

            // Verify the trust path using the above settings
            String provider = properties
                    .getProperty("org.apache.ws.security.crypto.merlin.cert.provider");
            CertPathValidator certPathValidator;
View Full Code Here

  }

  private void validateNoCache(List<X509Certificate> certs) throws CertValidatorException {
    try {
      CertPathValidator validator = CertPathValidator.getInstance(VALIDATOR_TYPE);
      PKIXParameters params = new PKIXParameters(trustRoots);
      params.setDate(timeSource.now());
      params.setRevocationEnabled(false);
      CertificateFactory certFactory = CertificateFactory.getInstance(CERTIFICATE_TYPE);
      CertPath certPath = certFactory.generateCertPath(certs);
      validator.validate(certPath, params);
    } catch (GeneralSecurityException e) {
      log.log(Level.WARNING, "Certificate validation failed, certs were: " + certs, e);
View Full Code Here

            // Generate cert path
            List cert_list = Arrays.asList(certs);
            CertPath path = getCertificateFactory().generateCertPath(cert_list);

            // Use the certificates in the keystore as TrustAnchors
            PKIXParameters param = new PKIXParameters(this.keystore);

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

            String provider = properties
                    .getProperty("org.apache.ws.security.crypto.merlin.cert.provider");

            CertPathValidator validator = null;
View Full Code Here

                        set.add(anchor);
                    }
                }
            }

            PKIXParameters param = new PKIXParameters(set);
            param.setRevocationEnabled(enableRevocation);
            if (enableRevocation && crlCertStore != null) {
                param.addCertStore(crlCertStore);
            }

            // Verify the trust path using the above settings
            String provider = getCryptoProvider();
            CertPathValidator validator = null;
View Full Code Here

                        new TrustAnchor(cert, cert.getExtensionValue(NAME_CONSTRAINTS_OID));
                    set.add(anchor);
                }
            }

            PKIXParameters param = new PKIXParameters(set);
            param.setRevocationEnabled(enableRevocation);

            // Verify the trust path using the above settings
            String provider = getCryptoProvider();
            CertPathValidator validator = null;
            if (provider == null || provider.length() == 0) {
View Full Code Here

TOP

Related Classes of java.security.cert.PKIXParameters

Copyright © 2018 www.massapicom. 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.