private File createKeystore()

in harness/src/main/java/org/apache/geode/perftest/jvms/RemoteJVMFactory.java [160:186]


  private File createKeystore()
      throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException,
      NoSuchProviderException, InvalidKeyException, SignatureException {

    CertAndKeyGen keyGen = new CertAndKeyGen("RSA", "SHA1WithRSA", null);
    keyGen.generate(1024);

    char[] password = "123456".toCharArray();
    PrivateKey privateKey = keyGen.getPrivateKey();

    // Generate self signed certificate
    X509Certificate[] chain = new X509Certificate[1];
    chain[0] = keyGen.getSelfCertificate(new X500Name("CN=ROOT"), DAYS.toSeconds(365));

    logger.debug("Certificate : {}", chain[0]);

    KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
    ks.load(null, null);
    ks.setKeyEntry("default", privateKey, password, chain);

    File jksFile = new File("temp-self-signed.jks");
    FileOutputStream fos = new FileOutputStream(jksFile);
    ks.store(fos, password);
    fos.close();

    return jksFile;
  }