Integrate the Entrust Timestamping Authority with the nShield HSM
Create a certificate request
-
Run the following command in the EDM VM terminal to load the HSM configuration.
sudo /usr/local/bin/tsactl import-nshield -f /opt/nfast/kmdataImporting overwrites any existing kmdatain TSA, and keys previously created in TSA are lost. Back up the existing material first and confirm that you are importing into the intended deployment.Review the overwrite prompt before answering. Expect confirmation that the secrets were established and that a redeploy is required.
-
Confirm that the Security World is usable.
[sysadmin@timestamping-auth-edm ~]$ /opt/nfast/bin/nfkminfo World generation 2 state 0x3737000c Initialised Usable ... Module #1 Slot #0 IC 217 generation 1 phystype SmartCard slotlistflags 0x2 SupportsAuthentication state 0x5 Operator flags 0x10000 shareno 2 shares LTU(PIN) LTFIPS error OK Cardset name "testOCS" k-out-of-n 1/5 flags NotPersistent PINRecoveryForbidden(disabled) !RemoteEnabled timeout none card names "" "" "" "" "" hkltu edb3d45a28e5a6b22b033684ce589d9e198272c2 gentime 2023-07-20 18:50:48 -
Create the key pair and the certificate signing request (CSR) for signing TSA responses.
sudo env NFAST_NFKM_TOKENSFILE=/tmp/preloadtoken /opt/nfast/bin/preload -c <cardset-name> /usr/local/bin/tsactl create-key -k RSA2048 -s "CN=TSA" -o /tmp/tsa-cert-request.txt -t <cardset-name> -v nshieldEnter the cardset passphrase at the preload prompt, and, if prompted by
tsactl, the HSM PIN. Keep the OCS in slot 0 until key creation completes. Do not use-Fwith OCS protection.If
/tmp/tsa-cert-request.txtalready exists,tsactlrequests confirmation before overwriting it. A successful run reportsSecret(s) establishedandCSR written in path: /tmp/tsa-cert-request.txt. A redeploy is required for the new configuration to take effect. -
Confirm the CSR. The file is root-owned, so use
sudo:sudo openssl req -in /tmp/tsa-cert-request.txt -noout -subject -verifyConfirm that OpenSSL reports the subject
CN=TSAand that the signature verifies. -
Stage a readable copy and transfer it to your CA workstation by an approved secure method:
sudo install -o sysadmin -g edm -m 0644 /tmp/tsa-cert-request.txt /home/sysadmin/tsa-cert-request.txt
Sign the certificate request
-
Create a timestamping certificate template in your CA to sign the
tsa-cert-request.txtCSR created in Create a certificate request. Name the template EntrustTimestampingAuth. The template is based on the Web Server certificate template, with these changes:-
Remove the Server Authentication application policy from the Extensions.
-
Add the Time Stamping application policy to the Extensions.
-
Mark the Extended Key Usage extension as critical.
-
Allow the subject to be supplied in the request.
-
Restrict Read and Enroll permissions to the accounts that submit TSA certificate requests.
Create the template on the CA that signs the TSA certificate. For a root and subordinate CA design, create and sign the certificate on the subordinate CA.
-
-
Sign the CSR with the template. The signed certificate file,
tsa-signed-cert.cerin this example, must contain a certificate in PEM format and Base64 encoding.certreq -submit -attrib "CertificateTemplate:EntrustTimestampingAuth" tsa-cert-request.txt -
Save the issued certificate as
tsa-signed-cert.cer. -
Confirm that the certificate has the Time Stamping extended key usage, marked as critical:
certutil -dump tsa-signed-cert.cerConfirm that the
Extended Key Usageextension listsTime Stampingand is markedcritical, and that the subject isCN=TSA. Check that the file is PEM Base64 by confirming its first line is-----BEGIN CERTIFICATE-----:findstr /b "-----BEGIN" tsa-signed-cert.cer
Export your root CA certificate
Your certificate chain will be needed to verify the time stamp in Test the integration.
-
Export the certificates of your CAs in the chain (root CA and any subordinate CA), as Base-64 encoded X.509 (.CER). Copy them to the workstation that will send the time stamp requests in Test the integration.
-
Concatenate the certificates into a single PEM file, with the root CA first:
type root-ca.cer sub-ca.cer > chain.pemReplace
root-ca.cerandsub-ca.cerwith your exported file names. Confirm thatchain.pemcontains one-----BEGIN CERTIFICATE-----block for each CA.