CertStore           certs = CertStore.getInstance("Collection",
certList.add(_signCrl); certList.add(_origCrl);  CertStore           certsAndCrls = CertStore.getInstance("Collection",
    public void testSHA1WithRSA()        throws Exception    {        List                  certList = new ArrayList();        ByteArrayOutputStream bOut = new ByteArrayOutputStream();                certList.add(_origCert);        certList.add(_signCert);            CertStore           certs = CertStore.getInstance("Collection",                        new CollectionCertStoreParameters(certList), "BC");            CMSSignedDataStreamGenerator gen = new CMSSignedDataStreamGenerator();            gen.addSigner(_origKP.getPrivate(), _origCert, CMSSignedDataStreamGenerator.DIGEST_SHA1, "BC");            gen.addCertificatesAndCRLs(certs);            OutputStream sigOut = gen.open(bOut);            sigOut.write(TEST_MESSAGE.getBytes());                sigOut.close();                CMSSignedDataParser     sp = new CMSSignedDataParser(                new CMSTypedStream(new ByteArrayInputStream(TEST_MESSAGE.getBytes())), bOut.toByteArray());            sp.getSignedContent().drain();                //        // compute expected content digest        //        MessageDigest md = MessageDigest.getInstance("SHA1", "BC");                verifySignatures(sp, md.digest(TEST_MESSAGE.getBytes()));                //        // try using existing signer        //        gen = new CMSSignedDataStreamGenerator();            gen.addSigners(sp.getSignerInfos());                gen.addCertificatesAndCRLs(sp.getCertificatesAndCRLs("Collection", "BC"));                bOut.reset();                sigOut = gen.open(bOut, true);            sigOut.write(TEST_MESSAGE.getBytes());                sigOut.close();            verifyEncodedData(bOut);    }