PKCS10CertificationRequestBuilder csrBuilder = new PKCS10CertificationRequestBuilder(
entityName, publicKeyInfo);
// SCEP servers usually require a challenge password
csrBuilder.addAttribute(
PKCSObjectIdentifiers.pkcs_9_at_challengePassword,
new DERPrintableString(new String("password".toCharArray())));
ContentSigner signer = signerBuilder.build(entityPair.getPrivate());
PKCS10CertificationRequest csr = csrBuilder.build(signer);
// Send the enrollment request
EnrollmentResponse response = client