With EC Key (Self Signed Certificate)

  1. Generate an EC keypair on Utimaco HSM.

›_ Console

keytool -genkeypair -alias utimacoECKey -keyalg EC -groupname secp256r1 -keystore NONE -storetype PKCS11 -providerClass sun.security.pkcs11.SunPKCS11 -providerArg /etc/utimaco/pkcs11-java.cfg

Provide information when prompted Here:

  • EC is the key algorithm

  • NONE is the keystore for HSM

  • PKCS11 is the storetype

  • sun.security.pkcs11.SunPKCS11 is the provider class

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

Provide the keystore password when prompted.

Screenshot 2026-04-02 172544.png


Keytool command to generate keys

It is recommended to use CA signed certificate for production environment.

  1. Verify the entry with same alias name is generated.

›_ Console

# keytool -list -keystore NONE -storetype PKCS11 -providerClass sun.security.pkcs11.SunPKCS11 -providerArg /etc/utimaco/pkcs11-java.cfg

Here:

  • NONE is the keystore for HSM

  • PKCS11 is the storetype

  • sun.security.pkcs11.SunPKCS11 is the provider class

Provide the keystore password when prompted.

Screenshot 2026-04-02 172618.png

Listkeys output

  1. List the objects using p11tool2.

›_ Console

# ./p11tool2 Slot=0 LoginUser=ask ListObjects

Enter user PIN when prompted.

Screenshot 2026-04-02 171328.png

List keys output using p11tool2

  1. Sign any sample jar file using jarsigner tool.

›_ Console

# jarsigner -tsa http://timestamp.digicert.com -keystore NONE -storetype PKCS11 -providerClass sun.security.pkcs11.SunPKCS11 -providerArg /etc/utimaco/pkcs11-java.cfg -signedjar HelloWorldECSigned.jar HelloWorld.jar utimacoECKey

Here:

  • http://timestamp.digicert.com is URL of timestamp server

  • Here NONE is the keystore for HSM

  • PKCS11 is the storetype

  • sun.security.pkcs11.SunPKCS11 is the provider class

  • HelloWorldECSigned.jar is the new output signed jar file that will be generated

  • HelloWorld.jar is the jar file to be signed

Screenshot 2026-04-02 172720.png

Signing the jar using jarsigner command

  1. Verify the signed jar.

›_ Console

# jarsigner -verify HelloWorldECSigned.jar

Here HelloWorldECSigned.jar is the newly generated signed jar file.

Screenshot 2026-04-02 172755.png

Verifying signed jar


This completes the Integration for PKCS11 with Utimaco SecurityServer.