Надувной замок предоставляет все инструменты, необходимые для этого.
Вот код для создания CSR:
PrivateKey priKey = entry.getPrivateKey(keystore, pwd);
PKCS10CertificationRequestBuilder p10Builder
= new JcaPKCS10CertificationRequestBuilder(
cert.getSubjectX500Principal(), cert.getPublicKey());
JcaContentSignerBuilder csBuilder = new JcaContentSignerBuilder(cert.getSigAlgName());
ContentSigner signer = csBuilder.build(priKey);
PKCS10CertificationRequest csr = p10Builder.build(signer);
try (OutputStream stream = new FileOutputStream(file);
Writer writer = new OutputStreamWriter(stream, "UTF-8");
JcaPEMWriter out = new JcaPEMWriter(writer)) {
out.writeObject(csr);
}