ProofOfPossession myProofOfPossession = new ProofOfPossession(new DERNull(), 0);
myCertReqMsg.setPop(myProofOfPossession);
AttributeTypeAndValue av = new AttributeTypeAndValue(CRMFObjectIdentifiers.regCtrl_regToken, new DERUTF8String("foo123"));
myCertReqMsg.addRegInfo(av);
CertReqMessages myCertReqMessages = new CertReqMessages(myCertReqMsg);
PKIHeader myPKIHeader = new PKIHeader(new DERInteger(2), new GeneralName(new X509Name("CN=bogusSubject")), new GeneralName(new X509Name("CN=bogusIssuer")));
myPKIHeader.setMessageTime(new DERGeneralizedTime(new Date()));
myPKIHeader.setSenderNonce(new DEROctetString(CmpMessageHelper.createSenderNonce()));
myPKIHeader.setTransactionID(new DEROctetString(CmpMessageHelper.createSenderNonce()));
PKIBody myPKIBody = new PKIBody(myCertReqMessages, 0);
PKIMessage myPKIMessage = new PKIMessage(myPKIHeader, myPKIBody);
// Create a bogus CrmfRequestMessage
CrmfRequestMessage crmf = new CrmfRequestMessage(myPKIMessage, "CN=SomeCA", true, null);
crmf.setPbeParameters("keyId", "key", "digestAlg", "macAlg", 100);