Integrate a new IIS deployment with the nShield HSM

This section describes how to integrate a new IIS server installation with an nShield HSM.

Create a certificate request

IIS Manager does not support the creation of certificate requests protected by CNG keys. These must be created using the Microsoft command-line utilities in Windows PowerShell.

  1. Verify the nCipher Primitive Provider and nCipher Security World Key Storage Provider are available. Otherwise, see section Install and register the CNG provider.

    >cnglist.exe --list-providers
    Microsoft Key Protection Provider
    Microsoft Passport Key Storage Provider
    Microsoft Platform Crypto Provider
    Microsoft Primitive Provider
    Microsoft Smart Card Key Storage Provider
    Microsoft Software Key Storage Provider
    Microsoft SSL Protocol Provider
    Windows Client Key Protection Provider
    nCipher Primitive Provider
    nCipher Security World Key Storage Provider
  2. Create a request.inf file for an SSL certificate linked to a 2048 RSA key protected by the HSM. Note the ProviderName set to nCipher Security World Key Storage Provider.

    For example:

    [Version]
    Signature= "$Windows NT$"
    
    [NewRequest]
    Subject = "CN=interop.local,C=US,ST=Florida,L=Sunrise,O=InteropLocal,OU=WebServer"
    HashAlgorithm = SHA256
    KeyAlgorithm = RSA
    KeyLength = 2048
    ProviderName = "nCipher Security World Key Storage Provider"
    KeyUsage = 0xf0
    MachineKeySet = True
    
    [EnhancedKeyUsageExtension]
    OID = 1.3.6.1.5.5.7.3.1
    
    [Extensions]
    2.5.29.17 = "{text}dns=interop.local&dns=msiiswin2025.interop.local&ipaddress=XX.XXX.XXX.XXX"
    Note the Extensions section, which specifies the server FQDN and IP address. Replace these values with those for your environment.
  3. Run the following command to create the certificate request.

    > certreq.exe -new request.inf IISCertRequest.csr
  4. Depending on the protection method selected when you set up the CNG provider, the nCipher Key Storage Provider - Create Key pop-up window may appear. If so:

    1. Select Next.

    2. Select Operator Card Set protection. Then select Next.

    3. Choose the OCS. Then select Next.

    4. Choose the HSM. Then select Finish.

    5. Present the OCS to the HSM.

    6. In the Card reading complete. window, select Finish.

  5. Verify that the command completed successfully.

    > certreq.exe -new request.inf IISCertRequest.csr
    
    CertReq: Request Created
  6. Verify that the IISCertRequest.csr file was created.

Sign the certificate request

Submit the CSR file for signature to your organization’s CA. For this integration, a local two-tier PKI infrastructure was used for signing. The signed certificate file is IISCertRequest.cer.

Install the certificate

Open a command window and run the following to make the signed certificate available for use in IIS.

> certreq -accept IISCertRequest.cer

Installed Certificate:
  Serial Number: 390000003957b936b67d64cb46000400000039
  Subject: CN=interop.local, OU=WebServer, O=InteropLocal, L=Sunrise, S=Florida, C=US (DNS Name=interop.local, DNS Name=msiiswin2025.interop.local, IP Address=XX.XXX.XXX.XXX)
  NotBefore: 6/29/2026 3:07 PM
  NotAfter: 6/28/2028 3:07 PM
  Thumbprint: 9b3b463003bfba1155d74635198a345b21ee77bd

Bind the certificate to the IIS server

  1. Go to Start > Internet Information Service Manager.

  2. Select the hostname, then double-click Server Certificates and verify the certificate you accepted in the previous step is listed.

  3. Under Sites on the left-hand side of the IIS Manager screen, select Default website.

  4. Select Bindings link on the right-hand side of the IIS Manager.

    sslbindings
  5. In the Site Bindings window, if the https protocol is not listed, add it now. To do this, select Add, set the protocol as https and select the required certificate from the list.

    If the https protocol already exists, select Edit instead. Ensure the SSL certificate selected matches the certificate accepted in the previous step.

    site bindings 2
  6. Select OK to complete the certificate binding for SSL connection.

  7. Select Close on the Site Bindings screen.

  8. Restart the IIS server.

    > iisreset

Verify the connection to the IIS server

Point your browser to the FQDN or IP address of the server using HTTPS.

https://xx.xxx.xxx.xxx
https://miiswin2025.interop.local
iis secure loaded