CertStore store2 = CertStore.getInstance("Collection", ccsp, "BC");
List storeList = new ArrayList();
storeList.add(store1);
storeList.add(store2);
CertStore store = CertStore.getInstance("Multi", new MultiCertStoreParameters(storeList));
// Searching for rootCert by subjectDN
X509CertSelector targetConstraints = new X509CertSelector();
targetConstraints.setSubject(rootCert.getSubjectX500Principal().getName());
Collection certs = store.getCertificates(targetConstraints);
if (certs.size() != 2 || !certs.contains(rootCert))
{
fail("2 rootCerts not found by subjectDN");
}
store = CertStore.getInstance("Multi", new MultiCertStoreParameters(storeList, false));
certs = store.getCertificates(targetConstraints);
if (certs.size() != 1 || !certs.contains(rootCert))
{
fail("1 rootCert not found by subjectDN");