CMSSignedData sd = new CMSSignedData(new CMSProcessableByteArray(TEST_MESSAGE.getBytes()), bOut.toByteArray());  assertEquals(1, sd.getSignerInfos().getSigners().size());
    public void testSHA1WithRSAEncapsulated()        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, true);        sigOut.write(TEST_MESSAGE.getBytes());                sigOut.close();                CMSSignedDataParser     sp = new CMSSignedDataParser(bOut.toByteArray());        sp.getSignedContent().drain();                verifySignatures(sp);                //        // 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);    }