- public static KeyPair generateKeypair() throws GeneralSecurityException {
- KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
- kpg.initialize(4096);
- return kpg.generateKeyPair();
- }
-
- public static String generatePEMCSR(KeyPair kp, String dn) throws GeneralSecurityException, IOException {
- PKCS10 p10 = new PKCS10(kp.getPublic(), new PKCS10Attributes());
- Signature s = Signature.getInstance("SHA256WithRSA");
- s.initSign(kp.getPrivate());
- p10.encodeAndSign(new X500Name(dn), s);
- return PEM.encode("CERTIFICATE REQUEST", p10.getEncoded());
+ public static String executeBasicWebInteraction(String cookie, String path, String query) throws MalformedURLException, UnsupportedEncodingException, IOException {
+ return executeBasicWebInteraction(cookie, path, query, 0);