return ret;
}
private byte[] createPKCS7(Certificate[] chain, PrivateKey pk, X509Certificate cert) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException, CertStoreException, CMSException, IOException {
Collection<Certificate> certList = Arrays.asList(chain);
CMSProcessable msg = new CMSProcessableByteArray(new byte[0]);
CertStore certs = CertStore.getInstance("Collection", new CollectionCertStoreParameters(certList), "BC");
CMSSignedDataGenerator gen = new CMSSignedDataGenerator();
gen.addCertificatesAndCRLs(certs);
// it is possible to sign the pkcs7, but it's not currently used
CMSSignedData s = null;