- PKCS10 p10 = new PKCS10(kp.getPublic(), new PKCS10Attributes());
- Signature s = Signature.getInstance("SHA256WithRSA");
+ return generatePEMCSR(kp, dn, new PKCS10Attributes());
+ }
+
+ public static String generatePEMCSR(KeyPair kp, String dn, PKCS10Attributes atts) throws GeneralSecurityException, IOException {
+ return generatePEMCSR(kp, dn, atts, "SHA256WithRSA");
+ }
+
+ public static String generatePEMCSR(KeyPair kp, String dn, PKCS10Attributes atts, String signature) throws GeneralSecurityException, IOException {
+ PKCS10 p10 = new PKCS10(kp.getPublic(), atts);
+ Signature s = Signature.getInstance(signature);