Generating Pem Format Private Keys

Convert the Java keytool to generate pem format private keys.

Prerequisites
Ensure that you have JDK 1.6 installed on your machine.
Task

Several Event Stream Processor utilities, including esp_client, esp_convert, esp_upload, esp_subscribe, esp_cnc, and esp_query, require the pem format private key.

The keystore tool is located in the $JAVA_HOME/bin directory.

  1. From the command line, run the following script to export the Java keystore to a PKCS12 format keystore, which is used by OpenSSL:
    keytool -importkeystore -srckeystore filename.jks  -destkeystore exportfilename.p12 -deststoretype PKCS12
    
    Note: The filename and exportfilename required in this command are variable.
    Press Return.
  2. Run the following command to convert the PKCS12 format keystore to a pem format private key:
    openssl pkcs12 -in filename.p12 -out username.private.pem -nodes
    
    Note: The user name required in this command is variable.
    Press Return.