ForwardBuilder(BuilderParams buildParams,boolean searchAllCertStores){
  super(buildParams);
  trustAnchors=buildParams.trustAnchors();
  trustedCerts=new HashSet<X509Certificate>(trustAnchors.size());
  trustedSubjectDNs=new HashSet<X500Principal>(trustAnchors.size());
  for (  TrustAnchor anchor : trustAnchors) {
    X509Certificate trustedCert=anchor.getTrustedCert();
    if (trustedCert != null) {
      trustedCerts.add(trustedCert);
      trustedSubjectDNs.add(trustedCert.getSubjectX500Principal());
    }
 else {
      trustedSubjectDNs.add(anchor.getCA());
    }
  }
  this.searchAllCertStores=searchAllCertStores;
}

ForwardBuilder ( BuilderParams buildParams , boolean searchAllCertStores ) { super ( buildParams ) ; trustAnchors = buildParams . trustAnchors ( ) ; trustedCerts = new HashSet < X509Certificate > ( trustAnchors . size ( ) ) ; trustedSubjectDNs = new HashSet < X500Principal > ( trustAnchors . size ( ) ) ; for ( TrustAnchor anchor : trustAnchors ) { X509Certificate trustedCert = anchor . getTrustedCert ( ) ; if ( trustedCert != null ) { trustedCerts . add ( trustedCert ) ; trustedSubjectDNs . add ( trustedCert . getSubjectX500Principal ( ) ) ; } else { trustedSubjectDNs . add ( anchor . getCA ( ) ) ; } } this . searchAllCertStores = searchAllCertStores ; }
initialize the builder with the input parameters .
