Generating a private key for your microservice SSL keystore

If you do not yet have a private key, generate one with the genrsa for OpenSSL command.

About this task

For more information about OpenSSL and the openssl command line tool, refer to https://www.openssl.org/docs/manmaster/man1/openssl.html.

Procedure

  1. If you do not yet have the openssl command line tool installed on your system, download it from https://www.openssl.org/source/ and install it.
  2. Consult your Certificate Authority (CA) Web site to learn the encryption cipher and private key size (in bytes) used by your CA.
  3. Run the following command to generate a private key:
    openssl genrsa -CIPHER -out OUTPUT.FILE KEYSIZE
    where:
    • CIPHER is the cipher used by your CA, for example, des3
    • OUTPUT.FILE is the name of the output file in which you want to store the key, for example, mymicroservice.key
    • KEYSIZE is the key size (in bytes) used by your CA, for example, 1024.
  4. Store the resulting private key file in a safe place and do not share it with anyone.