Generating SSL Key and Certificate on Windows for ECC Key and Certificate Generation

1. Generate an EC keypair on Utimaco HSM.

›_ Console

C:\Program Files\IBM\WebSphere\AppServer\java\8.0\jre\bin>keytool -genkey alias ibmec -keyalg EC -keystore NONE -storetype PKCS11IMPLKS -providername IBMPKCS11Impl-CryptoServer # keytool -genkey -alias ibmec -keyalg EC -keystore NONE -storetype PKCS11IMPLKS -providername IBMPKCS11Impl-CryptoServer 

Provide information when prompted.

Here:

  • EC is the key algorithm

  • NONE is the keystore for HSM

  • PKCS11IMPLKS is the storetype

  • IBMPKCS11Impl-CryptoServer is the provider name

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

Provide the keystore password when prompted.


tmpa5tmd5lp.jpg

Key generation using keytool command

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

›_ Console

C:\Program Files\IBM\WebSphere\AppServer\java\8.0\jre\bin>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 name

Provide the keystore password when prompted.

tmpev75ua1k.jpg

Keytool list command output

  1. List the objects using p11tool2.

›_ Console

C:\Program Files\Utimaco\SecurityServer\Administration>p11tool2 Slot=0 LoginUser=ask ListObjects 

Enter user PIN when prompted.

tmps6yttex4.jpg
tmpeutv7zlo.jpg

ListObjects output using p11tool2

4. Generate a CSR using Keytool command.

tmp233i5gms.jpg

Generate CSR command output

Here:

  • NONE is the keystore for HSM

  • PKCS11IMPLKS is the storetype

  • Provide the keystore password when prompted

  • IBMPKCS11Impl-CryptoServer is the provider name

  • ibmec is the key name

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

Provide the 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.

›_ Console

C:\Program Files\IBM\WebSphere\AppServer\java\8.0\jre\bin>keytool.exe importcert -alias rootca -file C:\Users\Downloads\RootCA.crt -storetype PKCS11IMPLKS -keystore NONE -providername IBMPKCS11Impl-CryptoServer 
tmp683fcuwi.jpg
tmpo13iip7j.jpg

Importing root CA certificate into keystore

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

›_ Console

C:\Program Files\IBM\WebSphere\AppServer\java\8.0\jre\bin>keytool -importcert -alias ibmec -file C:\Users\Downloads\ec_demo.p7b -storetype PKCS11IMPLKS keystore NONE -providername IBMPKCS11Impl-CryptoServer 
tmp3xl3ovhd.jpg

Importing user certificate into keystore

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

›_ Console

C:\Program Files\IBM\WebSphere\AppServer\java\8.0\jre\bin>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.

tmpzsotoqdb.jpg

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