Integrate the MS SQL Server with the Entrust CSP Vault

Get the vault information

  1. Sign in to the MS SQL Server host.

  2. From the MS SQL Server host, sign in to your vault web GUI.

  3. In the top left, under Administrator, select About from the drop-down menu.

    For example:

    vault info
  4. Make a note of the Vault ID.

Install the policy agent client on the MS SQL Server host

  1. Sign in to the MS SQL Server host.

  2. From the MS SQL Server host, sign in to your vault web GUI.

  3. In the toolbar select WORKLOADS.

  4. Select Actions, then select Download Policy Agent from the drop-down menu.

    For example:

    policy agents available
  5. Select Download next to the hcs-client-agent-<version>.exe file.

    Alternatively, download the hcs-client-agent.zip file and then extract the Windows executable.

  6. Select Close.

  7. Run the downloaded file, hcs-client-agent-<version>.exe.

    Alternatively, open the ZIP file and navigate to the hcs-client-agent\windows folder and then run the executable.

  8. Complete the install process using the default options.

  9. Upon completion, select Reboot now, then select Finish.

    reboot now

Register the MS SQL Server with your vault

  1. On the MS SQL Server host, sign in to your vault web GUI.

  2. In the toolbar, select WORKLOADS.

  3. Select Actions, then select Create New Cloud VM Set from the drop-down menu.

  4. In the Create Cloud VM set window, enter a Name and Description, then select Create and Close.

    new cloud vm set

    The new cloud VM set appears.

    new cloud vm set created
  5. Select the Start menu in the MS SQL Server host and navigate to Entrust DataControl.

  6. Select Register.

  7. In the Register window, enter the information as follows, then select Register and OK.

    For example:

    Parameter Value

    Name / IP

    First node of the Entrust CSP Vault cluster

    Username

    User created in Configure the Entrust CSP Vault

    Password

    User created in Configure the Entrust CSP Vault

    Vault ID

    See Get the vault information

    Cloud VM set

    Name of cloud VM set created above

    registration new
  8. After registration succeeds, select OK.

    registration successful

    The Entrust DataControl window now shows STATUS Connected.

  9. Close the window.

    registration status connected

Enable TDE on the MS SQL Server

  1. On the MS SQL Server host, open a command window as an administrator.

  2. Run the following command to enable TDE on the server:

    C:\Users\Administrator.INTEROP>hcl tde status
    
    TDE is not enabled on this VM
    
    C:\Users\Administrator.INTEROP>hcl tde enable
    Enabling tde will change permissions of some Files.
    Do you want to proceed? (y/n) y
    
    If you are enabling TDE for an Oracle database, follow the steps mentioned below from the Administritor Guide.
    "Administration Guide > KeyControl Vault for Databases > KeyControl with Oracle TDE > Configuring the Oracle Server Database"
    
    C:\Users\Administrator.INTEROP>hcl tde status
    
    TDE is enabled on this VM
    
    C:\Users\Administrator.INTEROP>hcl status
    
    Summary
    -------------------------------------------------------------------------------
    KeyControl: 10.194.148.220:443
    KeyControl list: 10.194.148.220:443
    Vault ID: a1ca134f-1d95-499f-a4cd-2c025f71c8d3
    Status: Connected
    Last heartbeat: Mon Apr  6 11:11:05 2026 (successful)
    Certificate Expiration: Apr  6 14:42:47 2027 GMT
  3. Sign in to your vault web GUI.

  4. In the toolbar select WORKLOADS, then select the VM tab.

    The Microsoft SQL Server host now appears.

    registration workloads vm

Create a TDE database keyset to hold the cloud keys

  1. On the MS SQL Server host, sign in to your vault web GUI.

  2. In the toolbar select CLOUDKEYS.

  3. Select Actions, then select Create Key Set from the drop-down menu.

  4. In the Create Key Set window, on the Details tab, enter the details as follows, then select Continue.

    For example:

    tde database keyset
  5. Enter the HSM information, if provisioned, then select Apply.

  6. After the keyset is successfully created, select Close.

    tde database keyset created

Create the database connector

  1. On the MS SQL Server host sign in to your vault web GUI.

  2. In the toolbar, select CLOUDKEYS, then select the Key Sets tab.

  3. Select your keyset created in Create a TDE database keyset to hold the cloud keys.

  4. Scroll down and select the Database Connectors tab.

  5. Select Create Connector Now.

  6. In the Create Database Connector window, select your Microsoft SQL Server host from the drop-down menu.

  7. Enter a name and select the expiration, then select Create. In this integration, we configure the connector to never expire.

    For example:

    create database connector
  8. Check the box next to the Database Connector created, then, from the Actions drop-down menu, select Generate Access Token.

  9. In the Generate Access Token window, select Generate Token.

    The access token is generated.

  10. Copy and save the Identity and Secret.

    For example:

    access token

Load the EKM provider on Microsoft SQL Server

  1. Launch Microsoft SQL Server Management Studio and connect to the SQL Server.

  2. Run the following query to enable the EKM provider:

    USE master
    GO
    
    -- Enable EKM provider
    sp_configure 'show advanced options', 1 ;
    GO
    RECONFIGURE;
    GO
    
    sp_configure 'EKM provider enabled', 1 ;
    GO
    RECONFIGURE;
    GO
    enable ekm provider
  3. Run the following query to load the EKM provider library:

    -- Load cryptographic provider
    CREATE CRYPTOGRAPHIC PROVIDER Entrust_CSP_Vault
    FROM FILE = 'C:\Program Files\hcs\bin\htsqlekm_provider.dll';
    GO
  4. Using the Identity and Secret from section Create the database connector, create a credential file in JSON format. Place this file where it is accessible to the SQL Server, for example C:\Users\Administrator\sqlcred.conf.

    {
        "identity" : "ms-sql-tde-entrust-csp-vault",
        "secret"   : "WsZdrsP0mpbrTVtZSLGs6sUOZylq0cB0FmpyNl7nNwiuN3PbjSThQj59eACZCg3IYZo/dtFn5Acr6FceJ+a/NAAhqS7keQ0T5cgXswjHVZz4gYrkqTPfMeUI8vM6z79E6qvVp/Fyr840nlhzle1nSKiVohD85Dmued40dRvOqFy4iKuNWEwBEk9bs35P1La1iYz1ANDm31QH0akhT6+C9sONOTsHSzs1JoZphNnPDN2PULJVIXkdo+yhbF+xBfW3P6N4JaQWK1aL09qIin/dX+Y/nBmeXbknKyiBJendO5jjSrRFMvkhZBNjEAlKdUucIaPBpoe2m6~NRT3gkHo/jSJ6dgKy9GpvcylgufDLzfz8jEfZuLKenfhSp5E75mJMfYqApuhBK56GfqpH+sp2NmhSdXyMcixE+6u+HLy/3VNTnf9HezmrFMPNq1NF6NZBB9dQyz6KBfZ9zjPpNu6H2kJFbH3jwkzYkfvnKBM9vC+ki25RTWNMOTQchf43LC3vaxup3QGNcBfUWqXFWxsmTSkSY04K3B+oDXVr77IoOGT59Fi6LhHv4ncEMr5w1dK2svRyf8W8iRebi0d1VsKbtgPg4KwoWdMp7U/VRxon16BeXvZgJ3YUFdsaCZL3eghjNFEWOHP/v33Sx8EtzL53oT/5xCJprze1U="
    }
  5. Run the following query to create login credentials for the administrator:

    -- Create credential for system administrator
    CREATE CREDENTIAL sa_entrust_csp_vault
    WITH IDENTITY = 'file:C:\Users\Administrator\sqlcred.conf',
    SECRET = 'ignore'
    FOR CRYPTOGRAPHIC PROVIDER Entrust_CSP_Vault;
    GO
    
    -- Add this credential to the system administrator login
    ALTER LOGIN [INTEROP\Administrator]
    ADD CREDENTIAL "sa_entrust_csp_vault";
    GO
    We recommend pointing to the sqlcred.conf file in the query instead of simply listing the actual identity and secret. The former is required for SQL Server clusters.

Create a master key in the Entrust CSP vault

  1. On the MS SQL Server host, sign in to your vault web GUI.

  2. In the toolbar select CLOUDKEYS, then select the Cloud Keys tab.

  3. In the Key Set drop-down menu, select your keyset created in Create a TDE database keyset to hold the cloud keys.

  4. Select Actions > Create CloudKey.

  5. In the Create CloudKey window Details tab, enter a Name and Description.

  6. Select the Cypher per your application requirements, then select Continue.

    SQL Server supports a maximum of 3072 bits for the Cypher.

    For example:

    create master key
  7. In the Schedule tab, select the required options, then select Apply and Close.

    The master key is created.

    create master key created

Create the TDE key and login on Microsoft SQL Server

  1. Launch Microsoft SQL Server Management Studio and connect to the SQL Server.

  2. Run the following query to create a TDE key protected by the EKM provider vault master key created in Create a master key in the Entrust CSP vault.

    USE master;
    CREATE ASYMMETRIC KEY TDE_Key
    FROM PROVIDER Entrust_CSP_Vault WITH
    PROVIDER_KEY_NAME = 'ms-sql-ekm-vault-master-key',
    CREATION_DISPOSITION = OPEN_EXISTING;
    GO
  3. Run the following query to create a login for the TDE user:

    -- Create login for TDE user
    CREATE LOGIN TDE_Login
    FROM ASYMMETRIC KEY TDE_Key ;
    GO
  4. Run the following query to create a credential for the TDE login:

    -- Create credential for the TDE user
    CREATE CREDENTIAL tde_entrust_csp_vault
    WITH IDENTITY = 'file:C:\Users\Administrator\sqlcred.conf',
    SECRET = 'ignore'
    FOR CRYPTOGRAPHIC PROVIDER Entrust_CSP_Vault;
    GO
    
    -- Add this credential to the TDE user login
    ALTER LOGIN TDE_Login
    ADD CREDENTIAL "tde_entrust_csp_vault";
    GO