CSR Generation Using HSM-Based Private Key

  1. Install openssl.

sudo dnf install openssl -y
openssl version
image-20260609-101858.png

openssl version

  1. Generate the CSR.

./p11tool2 Slot=0 LoginUser=Cloud123   PubKeyAttr=CKA_LABEL="rsa_public_key",CKA_MODULUS_BITS=2048,CKA_ID="01"   PrvKeyAttr=CKA_LABEL="rsa_private_key",CKA_EXTRACTABLE=CK_FALSE,CKA_ID="01"   Mech=CKM_SHA256_RSA_PKCS   DN='O=Integration,CN=utimaco.ssl4saas.com'   ExportP10=/tmp/testhsm_v1.csr

This command generates a CSR using an RSA key pair stored in the HSM by specifying key attributes, authentication details, and the required certificate subject information.

DN='O=Integration,CN=utimaco.ssl4saas.com'

Defines the subject name for the CSR:

  • O → Organization name (Integration).

  • CN → Common Name (domain name used in SSL certificate).