TransactionId transId = TransactionId.createTransactionId();
Nonce recipientNonce = Nonce.nextNonce();
Nonce senderNonce = recipientNonce;
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();