/** * Sets the required constraints on the target certificate or attribute * certificate. The constraints are specified as an instance of * <code>Selector</code>. If <code>null</code>, no constraints are * defined. * <p> * The target certificate in a PKIX path may be a certificate or an * attribute certificate. * <p> * Note that the <code>Selector</code> specified is cloned to protect * against subsequent modifications. * * @param selector a <code>Selector</code> specifying the constraints on * the target certificate or attribute certificate (or * <code>null</code>) * @see #getTargetConstraints * @see X509CertStoreSelector * @see X509AttributeCertStoreSelector */ public void setTargetConstraints(Selector selector) { if (selector != null) { this.selector = (Selector) selector.clone(); } else { this.selector = null; } }
/** * Return a collection of entries matching the passed in selector. * * @param selector the selector to validate entries against. * @return a possibly empty collection of matched entries. * @throws StoreException in case of an underlying issue. */ public Collection getMatches(Selector selector) throws StoreException { if (selector == null) { return entries.values(); } List results = new ArrayList(); for (Iterator it = entries.values().iterator(); it.hasNext();) { Object next = it.next(); if (selector.match(next)) { results.add(next); } } return Collections.unmodifiableList(results); }
if (selector.match(obj))
/** * Return the matches in the collection for the passed in selector. * * @param selector the selector to match against. * @return a possibly empty collection of matching objects. */ public Collection<T> getMatches(Selector<T> selector) { if (selector == null) { return new ArrayList<T>(_local); } else { List<T> col = new ArrayList<T>(); Iterator<T> iter = _local.iterator(); while (iter.hasNext()) { T obj = iter.next(); if (selector.match(obj)) { col.add(obj); } } return col; } }
/** * Sets the required constraints on the target certificate or attribute * certificate. The constraints are specified as an instance of * <code>Selector</code>. If <code>null</code>, no constraints are * defined. * <p> * The target certificate in a PKIX path may be a certificate or an * attribute certificate. * <p> * Note that the <code>Selector</code> specified is cloned to protect * against subsequent modifications. * * @param selector a <code>Selector</code> specifying the constraints on * the target certificate or attribute certificate (or * <code>null</code>) * @see #getTargetConstraints * @see X509CertStoreSelector * @see X509AttributeCertStoreSelector */ public void setTargetConstraints(Selector selector) { if (selector != null) { this.selector = (Selector) selector.clone(); } else { this.selector = null; } }
/** * Return a collection of entries matching the passed in selector. * * @param selector the selector to validate entries against. * @return a possibly empty collection of matched entries. * @throws StoreException in case of an underlying issue. */ public Collection getMatches(Selector selector) throws StoreException { if (selector == null) { return entries.values(); } List results = new ArrayList(); for (Iterator it = entries.values().iterator(); it.hasNext();) { Object next = it.next(); if (selector.match(next)) { results.add(next); } } return Collections.unmodifiableList(results); }
/** * Returns the required constraints on the target certificate or attribute * certificate. The constraints are returned as an instance of * <code>Selector</code>. If <code>null</code>, no constraints are * defined. * * <p> * The target certificate in a PKIX path may be a certificate or an * attribute certificate. * <p> * Note that the <code>Selector</code> returned is cloned to protect * against subsequent modifications. * * @return a <code>Selector</code> specifying the constraints on the * target certificate or attribute certificate (or <code>null</code>) * @see #setTargetConstraints * @see X509CertStoreSelector * @see X509AttributeCertStoreSelector */ public Selector getTargetConstraints() { if (selector != null) { return (Selector) selector.clone(); } else { return null; } }
&& !paramsPKIX.getTargetConstraints().match((X509Certificate) certs.get(0)))
/** * Returns the required constraints on the target certificate or attribute * certificate. The constraints are returned as an instance of * <code>Selector</code>. If <code>null</code>, no constraints are * defined. * * <p> * The target certificate in a PKIX path may be a certificate or an * attribute certificate. * <p> * Note that the <code>Selector</code> returned is cloned to protect * against subsequent modifications. * * @return a <code>Selector</code> specifying the constraints on the * target certificate or attribute certificate (or <code>null</code>) * @see #setTargetConstraints * @see X509CertStoreSelector * @see X509AttributeCertStoreSelector */ public Selector getTargetConstraints() { if (selector != null) { return (Selector) selector.clone(); } else { return null; } }
additionalLocationsEnabled = _params.additionalLocationsEnabled; selector = _params.selector == null ? null : (Selector) _params.selector.clone(); stores = new ArrayList(_params.stores); additionalStores = new ArrayList(_params.additionalStores);
additionalLocationsEnabled = _params.additionalLocationsEnabled; selector = _params.selector == null ? null : (Selector) _params.selector.clone(); stores = new ArrayList(_params.stores); additionalStores = new ArrayList(_params.additionalStores);