X500Name issuer = new X500Name("CN=CA");
X500Name subject = new X500Name("CN=Client");
IssuerAndSubject ias = new IssuerAndSubject(issuer, subject);
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(