Auto Light Dark
Auto Light Dark

Integration Steps

Configuring HGS Certificates with the Utimaco CryptoServer KSP

The HGS signing and encryption certificate private keys are generated using the Utimaco CryptoServer Key Storage Provider (KSP). Two certificate requests are created: one for the HGS encryption certificate and one for the HGS signing certificate.

Creating the HGS Encryption Certificate Request

Create a certificate request configuration file for the HGS encryption certificate. The request uses the Utimaco CryptoServer KSP so that the associated private key is generated and stored in the HSM.

Open Notepad to create the configuration file for the HGS encryption certificate request.

notepad C:\HGSencryption.inf

Add the following certificate request configuration to the file. The private key is created using the Utimaco CryptoServer KSP and configured as non-exportable.

[Version]
Signature="$Windows NT$"

[NewRequest]
Subject = "CN=HGSencryption.relecloud.com"
KeySpec = 1
KeyLength = 2048
Exportable = FALSE
MachineKeySet = TRUE
ProviderName = "Utimaco CryptoServer Key Storage Provider"
RequestType = PKCS10
HashAlgorithm = SHA256

[RequestAttributes]
CertificateTemplate = Host-Guardian-Server-Certs

Update the certificate subject name according to the HGS domain configured in the target environment.

Creating the HGS Signing Certificate Request

Create a certificate request configuration file for the HGS signing certificate. The request uses the Utimaco CryptoServer KSP so that the associated private key is generated and stored in the HSM.

Open Notepad to create the configuration file for the HGS signing certificate request.

notepad C:\HGSsigning.inf

Add the following certificate request configuration to the file. The private key is created using the Utimaco CryptoServer KSP and configured as non-exportable.

[Version]
Signature="$Windows NT$"

[NewRequest]
Subject = "CN=HGSsigning.relecloud.com"
KeySpec = 1
KeyLength = 2048
Exportable = FALSE
MachineKeySet = TRUE
ProviderName = "Utimaco CryptoServer Key Storage Provider"
RequestType = PKCS10
HashAlgorithm = SHA256

[RequestAttributes]
CertificateTemplate = Host-Guardian-Server-Certs

Update the certificate subject name according to the HGS domain configured in the target environment.

Generating the Certificate Requests

After creating the encryption and signing configuration files, generate the certificate requests using certreq. During this step, the corresponding private keys are created using the Utimaco CryptoServer Key Storage Provider.

Generate the encryption request.

certreq -new C:\HGSencryption.inf C:\HGSencryption.req

Generate the signing request.

certreq -new C:\HGSsigning.inf C:\HGSsigning.req

Confirming the Keys in the HSM

After generating both certificate requests, verify that the corresponding private keys have been created in the HSM.

cngtool listkeys

Confirm that two new RSA 2048-bit keys are listed in the configured CNG group. This confirms that the HGS signing and encryption private keys were generated through the Utimaco CryptoServer Key Storage Provider.

Issuing the HGS Certificates

After the HGS signing and encryption certificate requests are generated, submit both requests to the configured Certification Authority and install the issued certificates on the HGS server.

Submit the HGS encryption certificate request to the Certification Authority:

certreq -submit -config ".\<CA_Name>" C:\HGSencryption.req C:\HGSencryption.cer

After the certificate is issued, install the certificate and associate it with the previously generated private key:

certreq -accept C:\HGSencryption.cer

Submit the HGS signing certificate request to the Certification Authority:

certreq -submit -config ".\<CA_Name>" C:\HGSsigning.req C:\HGSsigning.cer

After the certificate is issued, install the certificate and associate it with the previously generated signing private key:

certreq -accept C:\HGSsigning.cer

Initializing Host Guardian Service

Obtaining the Certificate Thumbprints

After installing the HGS signing and encryption certificates, retrieve the certificates from the Local Machine certificate store. The certificate thumbprints are required to initialize HGS.

Run the following command to retrieve the HGS certificates:

$Certs = Get-ChildItem Cert:\LocalMachine\My\ -dnsname HGS*

Display the certificate subjects and thumbprints to identify the signing and encryption certificates:

$Certs | Select-Object Subject, Thumbprint

Assign the signing and encryption certificate thumbprints to the corresponding variables based on the certificate subjects.

$signing = ($Certs | Where-Object Subject -like '*HGSsigning*').Thumbprint
$encryption = ($Certs | Where-Object Subject -like '*HGSencryption*').Thumbprint

Ensure that $signing corresponds to the HGS signing certificate and $encryption corresponds to the HGS encryption certificate before continuing.

Initializing HGS

Initialize Host Guardian Service using the signing and encryption certificate thumbprints obtained in the previous step. This configures HGS to use the HSM-backed certificates for the HGS service.

Initialize-HgsServer `
    -HgsServiceName tpmHGS `
    -SigningCertificateThumbprint $signing `
    -EncryptionCertificateThumbprint $encryption `
    -TrustTpm

Granting Private-Key Access to the HGS Service Account

After HGS initialization, an HGS service account is created. Grant this service account read access to the private keys of both the HGS signing and encryption certificates so that HGS can use the HSM-backed keys.

Open the Local Machine certificate store:

certlm.msc

In the Certificate Manager, locate the HGS encryption certificate under Personal → Certificates. Right-click the certificate and select All Tasks → Manage Private Keys to configure access to the associated private key.

image-20261120-143430.png


Managing Private-Key Permissions for the HGS Encryption Certificate

Add the HGS service account created during HGS initialization and grant the account Read permission.

image-20261120-143749.png


Granting the HGS Service Account Read Access to the Encryption Private Key

Repeat the same procedure for both the HGS signing and HGS encryption certificates to grant the HGS service account read permission to the associated private keys.