/** * Makes a copy of this <code>PKIXParameters</code> object. Changes to the * copy will not affect the original and vice versa. * * @return a copy of this <code>PKIXParameters</code> object */ public Object clone() { ExtendedPKIXBuilderParameters params = null; try { params = new ExtendedPKIXBuilderParameters(getTrustAnchors(), getTargetConstraints()); } catch (Exception e) { // cannot happen throw new RuntimeException(e.getMessage()); } params.setParams(this); return params; }
/** * Creates an instance of <code>PKIXBuilderParameters</code> with the * specified <code>Set</code> of most-trusted CAs. Each element of the set * is a {@link TrustAnchor TrustAnchor}. * * <p> * Note that the <code>Set</code> is copied to protect against subsequent * modifications. * * @param trustAnchors a <code>Set</code> of <code>TrustAnchor</code>s * @param targetConstraints a <code>Selector</code> specifying the * constraints on the target certificate or attribute * certificate. * @throws InvalidAlgorithmParameterException if <code>trustAnchors</code> * is empty. * @throws NullPointerException if <code>trustAnchors</code> is * <code>null</code> * @throws ClassCastException if any of the elements of * <code>trustAnchors</code> is not of type * <code>java.security.cert.TrustAnchor</code> */ public ExtendedPKIXBuilderParameters(Set trustAnchors, Selector targetConstraints) throws InvalidAlgorithmParameterException { super(trustAnchors); setTargetConstraints(targetConstraints); }
if (pkixParams.getExcludedCerts().contains(tbvCert)) if (pkixParams.getMaxPathLength() != -1) if (tbvPath.size() - 1 > pkixParams.getMaxPathLength()) if (CertPathValidatorUtilities.findTrustAnchor(tbvCert, pkixParams.getTrustAnchors(), pkixParams.getSigProvider()) != null)
.getInstance((PKIXBuilderParameters) params); Selector certSelect = pkixParams.getTargetConstraints(); if (!(certSelect instanceof X509CertStoreSelector)) targets = CertPathValidatorUtilities.findCertificates((X509CertStoreSelector)certSelect, pkixParams.getStores()); targets.addAll(CertPathValidatorUtilities.findCertificates((X509CertStoreSelector)certSelect, pkixParams.getCertStores()));
for (Iterator it = extPKIX.getAdditionalStores().iterator(); it.hasNext();) paramsBldrPKIXBldr.addExcludedCerts(extPKIX.getExcludedCerts()); paramsBldrPKIXBldr.setMaxPathLength(extPKIX.getMaxPathLength());
paramsPKIXBldr.addExcludedCerts(extPKIX.getExcludedCerts()); paramsPKIXBldr.setMaxPathLength(extPKIX.getMaxPathLength()); targetStores = extPKIX.getStores();
matches.addAll(CertPathValidatorUtilities.findCertificates(certSelect, pkixParams.getCertStores())); matches.addAll(CertPathValidatorUtilities.findCertificates(certSelect, pkixParams.getStores())); matches.addAll(CertPathValidatorUtilities.findCertificates(certSelect, pkixParams.getAdditionalStores()));
/** * Returns an instance of <code>ExtendedPKIXParameters</code> which can be * safely casted to <code>ExtendedPKIXBuilderParameters</code>. * <p> * This method can be used to get a copy from other * <code>PKIXBuilderParameters</code>, <code>PKIXParameters</code>, * and <code>ExtendedPKIXParameters</code> instances. * * @param pkixParams The PKIX parameters to create a copy of. * @return An <code>ExtendedPKIXBuilderParameters</code> instance. */ public static ExtendedPKIXParameters getInstance(PKIXParameters pkixParams) { ExtendedPKIXBuilderParameters params; try { params = new ExtendedPKIXBuilderParameters(pkixParams .getTrustAnchors(), X509CertStoreSelector .getInstance((X509CertSelector) pkixParams .getTargetCertConstraints())); } catch (Exception e) { // cannot happen throw new RuntimeException(e.getMessage()); } params.setParams(pkixParams); return params; } }
.getInstance(pkixParams); CertPathValidatorException lastException = null; for (Iterator it = holderPKCs.iterator(); it.hasNext();) params.setTargetConstraints(selector); CertPathBuilder builder = null; try .getInstance(params));
if (pkixParams.getExcludedCerts().contains(tbvCert)) if (pkixParams.getMaxPathLength() != -1) if (tbvPath.size() - 1 > pkixParams.getMaxPathLength()) if (CertPathValidatorUtilities.findTrustAnchor(tbvCert, pkixParams.getTrustAnchors(), pkixParams.getSigProvider()) != null)
.getInstance((PKIXBuilderParameters) params); Selector certSelect = pkixParams.getTargetConstraints(); if (!(certSelect instanceof X509AttributeCertStoreSelector)) targets = CertPathValidatorUtilities.findCertificates((X509AttributeCertStoreSelector)certSelect, pkixParams.getStores()); issuers.addAll(CertPathValidatorUtilities.findCertificates(selector, pkixParams.getStores())); issuers.addAll(CertPathValidatorUtilities.findCertificates(selector, pkixParams.getCertStores()));
/** * Returns an instance of <code>ExtendedPKIXParameters</code> which can be * safely casted to <code>ExtendedPKIXBuilderParameters</code>. * <p> * This method can be used to get a copy from other * <code>PKIXBuilderParameters</code>, <code>PKIXParameters</code>, * and <code>ExtendedPKIXParameters</code> instances. * * @param pkixParams The PKIX parameters to create a copy of. * @return An <code>ExtendedPKIXBuilderParameters</code> instance. */ public static ExtendedPKIXParameters getInstance(PKIXParameters pkixParams) { ExtendedPKIXBuilderParameters params; try { params = new ExtendedPKIXBuilderParameters(pkixParams .getTrustAnchors(), X509CertStoreSelector .getInstance((X509CertSelector) pkixParams .getTargetCertConstraints())); } catch (Exception e) { // cannot happen throw new RuntimeException(e.getMessage()); } params.setParams(pkixParams); return params; } }
/** * Makes a copy of this <code>PKIXParameters</code> object. Changes to the * copy will not affect the original and vice versa. * * @return a copy of this <code>PKIXParameters</code> object */ public Object clone() { ExtendedPKIXBuilderParameters params = null; try { params = new ExtendedPKIXBuilderParameters(getTrustAnchors(), getTargetConstraints()); } catch (Exception e) { // cannot happen throw new RuntimeException(e.getMessage()); } params.setParams(this); return params; }
/** * Creates an instance of <code>PKIXBuilderParameters</code> with the * specified <code>Set</code> of most-trusted CAs. Each element of the set * is a {@link TrustAnchor TrustAnchor}. * * <p> * Note that the <code>Set</code> is copied to protect against subsequent * modifications. * * @param trustAnchors a <code>Set</code> of <code>TrustAnchor</code>s * @param targetConstraints a <code>Selector</code> specifying the * constraints on the target certificate or attribute * certificate. * @throws InvalidAlgorithmParameterException if <code>trustAnchors</code> * is empty. * @throws NullPointerException if <code>trustAnchors</code> is * <code>null</code> * @throws ClassCastException if any of the elements of * <code>trustAnchors</code> is not of type * <code>java.security.cert.TrustAnchor</code> */ public ExtendedPKIXBuilderParameters(Set trustAnchors, Selector targetConstraints) throws InvalidAlgorithmParameterException { super(trustAnchors); setTargetConstraints(targetConstraints); }