For OpenJDK8 with EC Key

1. Generate an EC keypair on Utimaco HSM.

›_ Console

# keytool -genkey -alias tomsslec -keyalg EC -keystore NONE -storetype PKCS11 
-storepass 12345678 -providername SunPKCS11-CryptoServer -v 

Provide information when prompted Here:

  • EC is the key algorithm

  • NONE is the keystore for HSM

  • PKCS11 is the storetype

  • 12345678 is the slot PIN

  • SunPKCS11-CryptoServer is the provider name

  • tomsslec is the key name that will be generated on Utimaco HSM

tmpbrhv7q6g.jpg

Key generation using keytool command output

2. Verify that the keys have been generated.

›_ Console

# keytool -list -keystore NONE -storetype PKCS11 -providername SunPKCS11-
CryptoServer -storepass 12345678 -v 

Here:

  • NONE is the keystore for HSM

  • PKCS11 is the storetype

  • 12345678 is the slot PIN

  • SunPKCS11-CryptoServer is the provider’s name

tmpp2t_e282.jpg

Listkeys output

  1. List the keys using p11tool2.

›_ Console

# /opt/utimaco/bin/p11tool2 Slot=0 LoginUser=12345678 ListObjects 
tmp34fk1a8k.jpg

List Keys output using p11tool2

4. Generate a CSR using Keytool command.

›_ Console

# keytool -certreq -keystore NONE -storetype PKCS11 -storepass 12345678 providername SunPKCS11-CryptoServer -alias tomsslec  -file tomcatec.csr 

Here:

  • NONE is the keystore for HSM

  • PKCS11 is the storetype

  • 12345678 is the slot PIN

  • SunPKCS11-CryptoServer is the provider name

  • tomsslec is the key name

  • tomcatec.csr is the CSR file name that will be generated

  1. Get this CSR signed by CA.

  2. Copy the signed certificate along with root CA certificate chain on the tomcat server.

  3. Import the signed certificate chain reply using the command below.

›_ Console

# keytool -importcert -trustcacerts -alias tomsslec -file 
/home/tomcat/test_ec.p7b -storetype PKCS11 -keystore NONE -providername SunPKCS11-CryptoServer -storepass 12345678 
tmpn4xptijp.jpg
tmpkdeblbnm.jpg

Import user certificate into keystore

Signed certificate must also contain certificate chain.

  1. Verify that the keytool command shows the signed certificate as well as root CA certificate in console put below cmd.

›_ Console

# keytool -list -keystore NONE -storetype PKCS11 -providername SunPKCS11-
CryptoServer -storepass 12345678 -v 

Here:

  • NONE is the keystore for HSM

  • PKCS11 is the storetype

  • 12345678 is the slot PIN

  • SunPKCS11-CryptoServer is the provider’s name

tmpapij7qor.jpg
tmpktlrws0e.jpg

Keytool list output