BigInteger serial = BigInteger.ONE;
IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(issuer, serial);
PKCS10CertificationRequest csr = getCsr(new X500Principal("CN=Client"),
pair.getPublic(), pair.getPrivate(), "password".toCharArray());
CMSSignedDataGenerator gen = new CMSSignedDataGenerator();
ContentSigner sha1Signer = new JcaContentSignerBuilder("SHA1withRSA")
.build(pair.getPrivate());
X509Certificate cert = X509Certificates.createEphemeral(
new X500Principal("CN=client"), pair);
Store certs = new JcaCertStore(Collections.singleton(cert));
gen.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(