Privileged access management
Curity

Create a Java KeyStore

5min

Secure connections in Curity rely on you storing a server private key and certificate in the Java KeyStore saved on the HSM. The system presents this server certificate to clients when they connect to the Tomcat server. Typically, you create the KeyStore by using the keytool application bundled with Java (usually located in $JAVA_HOME/jre/bin/).

Perform the following tasks to create a Java KeyStore:

  1. Generate a server key pair and self-signed certificate.
  2. Generate and export a CSR.
  3. Import a CA root certificate.
  4. Import the server certificate signed by the CA.

Because the JDK 17 installation includes keytool, you can run the commands without additional configuration.

The following sections show how to perform these tasks:

1 | Generate a server key pair and self-signed certificate

1

Execute the following command:

-alias sets a name to identify the key pair and certificate to be generated. It can be any name (for example, CurityDemo). You use this name when configuring the key in Curity.

Shell

2

When prompted, enter the following information for the server certificate you want to generate and provide a new KeyStore password, which all subsequent keytool and jarsigner commands:

Text


2 | Generate and export a CSR

1

To generate and export a CSR, run the following command:

Shell

2

Enter the KeyStore password.

3

Send the CSR to a third-party or internal CA to get it signed.

The CA returns the server certificate and CA certificate for you to import.

3 | Import a CA root certificate

1

To import the CA root certificate, run the following command:

Shell

2

Enter the KeyStore password.

3

When prompted to trust the certificate, enter Yes as shown in the following example:

Shell


4 | Import the server certificate signed by the CA

1

To import the signed server certificate, run the following command:

Shell

2

Enter the KeyStore password.

If the command was successful, you should see an output similar to the following example:

Shell