For RSA Key and Certificate Generation

1. Generate a keypair on Utimaco HSM with the help of keytool command.

›_ Console

# keytool -genkey -alias ibmrsa -keyalg RSA -keysize 2048 -keystore NONE storetype PKCS11IMPLKS -providername IBMPKCS11Impl-CryptoServer 

Provide information when prompted.

Here:

  • RSA is the key algorithm

  • 2048 is the key size

  • NONE is the keystore for HSM

  • PKCS11IMPLKS is the storetype

  • IBMPKCS11Impl-CryptoServer is the provider name

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

Provide the keystore password when prompted.

tmpndrmvivc.jpg

Key generation using Keytool command

2. Verify the entry with same alias name using keytool command.

›_ Console

# keytool -list -keystore NONE -storetype PKCS11IMPLKS -providername 
IBMPKCS11Impl-CryptoServer

Here:

  • NONE is the keystore for HSM

  • PKCS11IMPLKS is the storetype

  • IBMPKCS11Impl-CryptoServer is the provider’s name

Provide the keystore password when prompted.


tmp_vy4xu4t.jpg

Keytool list output

  1. List the objects using p11tool2.

›_ Console

# p11tool2 Slot=0 LoginUser=ask ListObjects 

Enter user PIN when prompted.


tmp0778lv_d.jpg
tmp_06n50ma.jpg

ListObjects output using p11tool2

  1. Generate a CSR using Keytool command.

›_ Console

# keytool -certreq -alias ibmrsa -keystore NONE -storetype PKCS11IMPLKS providername IBMPKCS11Impl-CryptoServer -file ibm.csr 
tmpuxqf6dng.jpg

Generate CSR command output

Here:

  • NONE is the keystore for HSM

  • PKCS11IMPLKS is the storetype

  • IBMPKCS11Impl-CryptoServer is the provider name

  • ibmrsa is the key name

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

Provide keystore password when prompted.

  1. Get this CSR signed by CA.

  2. Copy the signed certificate and root CA certificate on the IBM WebSphere Application Server.

  3. Import Root CA certificate into HSM keystore.


tmpgp71byoi.jpg
tmp9qcm0l2e.jpg

Importing root CA certificate into keystore

Provide keystore password when prompted.

  1. Import the signed certificate reply using the command below.

›_ Console

#  keytool -importcert -alias ibmrsa -file /home/test_demo.p7b -storetype 
PKCS11IMPLKS -keystore NONE -providername IBMPKCS11Impl-CryptoServer 
tmpu5hp70rn.jpg

Importing user certificate into keystore

9. Verify that the keytool command shows the signed certificate as well as root CA certificate

›_ Console

# keytool -list -keystore NONE -storetype PKCS11IMPLKS -providername 
IBMPKCS11Impl-CryptoServer 

Here:

  • NONE is the keystore for HSM

  • PKCS11IMPLKS is the storetype

  • IBMPKCS11Impl-CryptoServer is the provider’s name

Provide the keystore password when prompted.

tmpbeuq3_zd.jpg

Keytool list output showing signed certificate as well as root CA certificate