CertStore certs = CertStore.getInstance("Collection",
new CollectionCertStoreParameters(certList), "BC");
ASN1EncodableVector signedAttrs = generateSignedAttributes();
SMIMESignedGenerator gen = new SMIMESignedGenerator();
gen.addSigner(_signKP.getPrivate(), _signCert, SMIMESignedGenerator.DIGEST_SHA256, new AttributeTable(signedAttrs), null);
gen.addCertificatesAndCRLs(certs);
X509AttributeCertificate attrCert = CMSTestUtil.getAttributeCertificate();
X509Store store = X509Store.getInstance("AttributeCertificate/Collection",
new X509CollectionStoreParameters(Collections.singleton(attrCert)), "BC");
gen.addAttributeCertificates(store);
SMIMESigned s = new SMIMESigned(gen.generateEncapsulated(msg, "BC"));
verifyMessageBytes(msg, s.getContent());
verifySigners(s.getCertificatesAndCRLs("Collection", "BC"), s.getSignerInfos());