.build(pair.getPrivate());
X509Certificate cert = X509Certificates.createEphemeral(
new X500Principal("CN=client"), pair);
Store certs = new JcaCertStore(Collections.singleton(cert));
gen.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(
new JcaDigestCalculatorProviderBuilder().build()).build(
sha1Signer, cert));
gen.addCertificates(certs);
CMSTypedData msg = new CMSAbsentContent();
CMSSignedData sigData = gen.generate(msg, false);