1.0 Introduction
This article describes the steps to integrate Microsoft Active Directory Certificate Services (AD CS) with Fortanix-Data-Security-Manager (DSM) using the Fortanix CNG Key Storage Provider (KSP).
In a Microsoft PKI setup, the Certification Authority (CA) generates and stores its private keys locally on the server. But many organizations now prefer using external key management systems to keep their CA keys secure. Fortanix DSM provides a secure, cloud-based way to store and manage these private keys. It offers features such as access control, approval policies, detailed logging, and hardware-backed security to protect keys outside the server.
It includes steps for both new deployments and key migration, including:
Setting up a new CA with its private key generated and stored in Fortanix DSM.
Moving an existing CA to a new server while keeping the same certificate and private key.
Migrating a root CA’s private key from local storage to Fortanix DSM without changing the server.
It also contains the information related to:
Installing and configuring Fortanix DSM for key storage.
Setting up Microsoft AD CS with Fortanix CNG KSP.
Using Fortanix DSM-managed keys for issuing certificates.
Migrating existing CA keys to Fortanix DSM.
Verifying key usage through Fortanix logs and Windows certificate tools.
2.0 Prerequisites
Ensure the following:
Install the Fortanix CNG KSP. For more information, refer to the CNG Developers Guide.
Use
certutil
to verify the correct installation of the Fortanix CNG KSP.
3.0 Product Versions Tested
The following product versions were tested:
Fortanix DSM version 5.0.
4.0 Configure Fortanix DSM
A Fortanix DSM service must be configured, and the URL must be accessible. To create a Fortanix DSM account and group, refer to the following sections:
4.1 Signing Up
To get started with the Fortanix DSM cloud service, you must register an account at <Your_DSM_Service_URL>. For example, https://eu.smartkey.io.
For detailed steps on how to set up the Fortanix DSM, refer to the User's Guide: Sign Up for Fortanix Data Security Manager SaaS documentation.
4.2 Creating an Account
Access <Your_DSM_Service_URL> in a web browser and enter your credentials to log in to Fortanix DSM.
.png?sv=2022-11-02&spr=https&st=2025-06-25T05%3A59%3A42Z&se=2025-06-25T06%3A21%3A42Z&sr=c&sp=r&sig=S8u9XUOubAVRw8hvvWRLuOugaVw%2Bw0tF4JoYxFv0c%2B8%3D)
Figure 1: Logging in
For more information on how to set up an account in Fortanix DSM, refer to the User's Guide: Getting Started with Fortanix Data Security Manager - UI.
4.3 Creating a Group
Perform the following steps to create a group in the Fortanix DSM:
In the DSM left navigation panel, click the Groups menu item, and then click the + button to create a new group.
Figure 2: Add groups
On the Adding new group page, do the following:
Title: Enter a name for your group.
Description (optional): Enter a short description of the group.
Click SAVE to create the new group.
The new group is added to the Fortanix DSM successfully.
4.4 Creating an Application
Perform the following steps to create an application (app) in the Fortanix DSM:
In the DSM left navigation panel, click the Apps menu item, and then click the + button to create a new app.
Figure 3: Add application
On the Adding new app page, do the following:
App name: Enter the name for your application.
ADD DESCRIPTION (optional): Enter a short description of the application.
Authentication method: Select the default API Key as the authentication method from the drop down menu. For more information on these authentication methods, refer to the User's Guide: Authentication.
Assigning the new app to groups: Select the group created in Section 4.3: Creating a Group from the list.
Click SAVE to add the new application.
The new application is added to the Fortanix DSM successfully.
4.5 Copying the API Key
Perform the following steps to copy the API key from the Fortanix DSM:
In the DSM left navigation panel, click the Apps menu item, and then click the app created in Section 4.4: Creating an Application to go to the detailed view of the app.
On the INFO tab, click VIEW API KEY DETAILS.
From the API Key Details dialog box, copy the API Key of the app to use it later.
5.0 Configure Microsoft Active Directory Certificate Services
This section describes the process of configuring Microsoft AD CS with Fortanix DSM. It includes installing the AD CS role, selecting the appropriate private key option, and integrating with the Fortanix CNG KSP. Fortanix DSM supports all key association options: generating a new private key, using an existing certificate and private key, or importing an existing private key.
5.1 Installing AD CS Role
Perform the following steps to install Microsoft AD CS role:
Open Server Manager and select Active Directory Certificate Services as one of the services to install.
Figure 4: Set active directory as service
Select Certification Authority as one of the role services to install for AD CS.
Figure 5: Select role services
5.2 Configuring CA Role
Perform the following steps to configure a CA role:
The CA installed in the previous step must have a private key to sign and issue certificates to clients. There are 3 ways to associate a private key with the CA:
By creating a new private key
By selecting an existing certificate and using its associated private key
By selecting an existing private key
The Fortanix CNG KSP supports all the above options.
Figure 6: All three types of private key support
5.3 Creating a New Private Key
Perform the following steps to create a new private key:
Select the Create a new private key option and click Next.
Figure 7: Create a new private key
If you select the option to create a new private key, you will next be asked to select the cryptographic provider. Select RSA#Fortanix SDKMS Provider as the cryptographic provider if you want to use an RSA key for the CA.
Figure 8: Select cryptographic provider
5.4 Verifying Key Creation in Fortanix DSM
After confirming your selections, verify that a new key has been generated in the Fortanix DSM user interface (UI). The CA is now ready to issue certificates.
.png?sv=2022-11-02&spr=https&st=2025-06-25T05%3A59%3A42Z&se=2025-06-25T06%3A21%3A42Z&sr=c&sp=r&sig=S8u9XUOubAVRw8hvvWRLuOugaVw%2Bw0tF4JoYxFv0c%2B8%3D)
Figure 9: Verify new key
NOTE
If you have a Quorum approval policy enabled on your group, then add the app in the OR section of the Quorum approval policy for it to authenticate; otherwise, you will see the error on the AD CS side.
6.0 Migrate CA to a New Server Using Existing Certificate and Private Key
This section explains how to move a CA from one server (Machine #1) to another (Machine #2) using the existing CA certificate and its private key. You will back up the CA database and certificate on the first machine, copy them to the second machine, and then restore the CA. This process keeps the CA identity the same and avoids issuing a new root certificate. You will also use the Fortanix CNG provider on the new server to manage the private key securely.
6.1 Backing up CA Configuration and Certificate from Source Server (Machine #1)
This section describes the steps to back up the CA configuration from the source server. It includes exporting the CA certificate and private key and saving the CA database. These components are required to restore the CA on a new server while preserving the same certificate and private key.
6.1.1 Extracting CA Configuration
Run the certutil
command to extract the configuration information:

Figure 10: Extract configuration information
6.1.2 Backing up CA Database
After you have the configuration information, run the following command to back up the database:
certutil -config <CA_config_string> -backupdb <BackupDirectory>
For example:

Figure 11: Backup the database
6.1.3 Exporting CA Certificate
Perform the following steps to export the certificate from Machine #1:
Run
mmc
.In the console, go to File → Add/Remove Snap-in.
Select the Certificates tab and click Add.
The certificate snap-in window opens. Select Computer Account and click Next.
Keep the default selection and click Finish, then click OK.
Go to the directory
Trusted Root Certification Authorities
→Certificates
.Right-click the CA certificate, click All Tasks → Export, then click Next.
Select Base-64 encoded X.509 (.CER) and click Next.
Specify the path and file name to save the certificate and click Next.
Click Finish.
Click OK to close the export success message.
Figure 12: Export the certificate from machine #1
6.1.4 Transferring Backup Files to Target Server (Machine #2)
The two folders must be saved in your location: one containing the CA backup (CABackup
) and another with the exported certificate (Export
). Copy both folders to the new machine (Machine #2).

Figure 13: Copy the folders on a new machine
6.2 Restoring and Reconfiguring CA on Target Server (Machine #2)
This section describes the steps to restore the backed-up CA certificate and configuration on a new (target) server. It includes installing the Fortanix CNG provider, importing the certificate, mapping it to the private key stored in Fortanix DSM, and configuring Microsoft AD CS to use the restored certificate. Once completed, the CA on the target server resumes operation using the original private key.
6.2.1 Preparing the Target Server
Perform the following steps to prepare the target server:
On a clean Windows Server machine where no configuration has been done for ADCS, install the Fortanix CNG in Machine #2 and configure it as per the readme file.
Figure 14: Install Fortanix CNG on machine #2
Copy the
Backup1
andExport
folders to the Desktop location.
6.2.2 Importing the CA Certificate
Perform the followings steps to import a CA certificate:
Install the X.509 certificate into the local user Trusted root CA store on machine #2.
Right-click the certificate and click Install.
Click Next.
Select Place all certificates in the following store and click Browse.
Select Trusted Root Certification Authorities and click OK.
Click Next.
Click Finish.
Click OK to close the import success message.
The SDKMS-CA certificate appears under Trusted Root Certification Authorities, indicating a successful import.
Run the following command to install the certificate into my store:
certutil -addstore my <certificate name>
For example:
certutil -addstore my CA_Certificate.cer
Where,
Certificate.cer
is the exported certificate in Base-64 encoded X.509 (.CER
).Figure 15: Install the certificate
After you run the above command, the exported CA appears in the Personal Trust store.
Figure 16: Exported CA in personal trust store
6.2.3 Mapping the Certificate to Fortanix DSM Private Key
Perform the following steps to map the certificate to Fortanix DSM private key:
Run the following command to repair the certificate store:
certutil -f -repairstore -csp "Fortanix KMS CNG Provider" my "<cert serial number>"
Where, Fortanix KMS CNG Provider is the CA Provider and the certificate serial number.
Run the following command to view the certificate serial number:
certutil -store my
For example:
Figure 17: Certificate serial number
6.2.4 Installing and Configuring AD CS
Perform the following steps to install and configure AD CS:
Click Start → Server Manager to open the Server Manager on Machine #2.
Install and configure the CA.
Install and configure the AD CS with the following settings:
In the Set Up Private Key window, select Use existing private key and then select a certificate and use its associated private key.
In the Existing Certificate window, the imported certificate is shown. Select the certificate and select Allow administrator interaction when the private key is accessed by the CA.
Click Next.
In the Certificate Database window, click Next.
In the Confirmation window, click Configure.
When the CA installation is complete, click Close in the installation results window.
Machine #2 now shows the configured CA.
Figure 18: Certificate serial number
Figure 19: Certificate serial number
6.2.5 Restoring CA Database and Verifying Fortanix DSM Usage
Run the following command to restore the backup of the database certificate:
certutil -restoredb <BackupDirectory>
After configuring the CA certificate, verify activity in the Fortanix DSM certificate logs.
.png?sv=2022-11-02&spr=https&st=2025-06-25T05%3A59%3A42Z&se=2025-06-25T06%3A21%3A42Z&sr=c&sp=r&sig=S8u9XUOubAVRw8hvvWRLuOugaVw%2Bw0tF4JoYxFv0c%2B8%3D)
Figure 20: Check logs in Fortanix DSM
7.0 Migrate Local Root CA Private Key to Fortanix DSM
This section describes the steps to migrate a local root CA private key to Fortanix DSM. The process includes identifying the root CA certificate, backing up the CA along with its private key, extracting the key and certificate, importing the private key into Fortanix DSM, and reconfiguring the CA to use the Fortanix DSM-managed key.
7.1 Backing Up the Root CA Certificate and Configuration
Perform the following steps to back up and configure the root CA certificate:
Identify the root CA certificate in the Microsoft Management Console (MMC).
It is usually located under Personal or Trusted Root Certification Authorities in either the current user or local computer certificate stores.
Figure 21: Locate root CA in MMC
Figure 22: View certificate in store
Open Server Manager → Tools → Certificate Authority. Right-click the CA name and select All Tasks → Back up CA.
Figure 23: Backup CA from MMC
In the Certification Authority Backup Wizard, select the option to include the private key and CA certificate in the backup. Set a password to protect the exported file.
Figure 24: Select key and certificate in backup
Run the following command to back up the CA database:
certutil -config <CA_config_string> -backupdb <BackupDirectory>
7.2 Preparing for Migration
Perform the following steps to prepare the server for migration:
Uninstall the Microsoft AD CS role from Server Manager.
Download and configure the Fortanix CNG provider. For more information, refer to the CNG Developers Guide.
7.3 Extracting and Importing the Private Key to Fortanix DSM
Perform the following steps to extract and import the private key in to Fortanix DSM:
Run the following OpenSSL commands to extract the private key and certificate from the backed-up CA certificate:
openssl.exe pkcs12 -in <BACKED_UP_CA_CERT> -nocerts -nodes -out private_key.pem openssl.exe pkcs12 -in <BACKED_UP_CA_CERT> -nokeys -nodes -out <CERTIFICATE_NAME>.crt
Figure 25: Extract key and certificate using OpenSSL
Go to the Fortanix DSM group as created in Section 4.3: Creating a Group, click + SECURITY OBJECT to add a new security object.
On the Add New Security Object form, do the following:
Security Object name: Enter the name of your security object.
Select the IMPORT radio button.
In the Choose a type section, select the RSA key type.
In the Place value here or import from file section, select the value format type as Base64 and click UPLOAD A FILE to upload the key file. Browse and select the private key from your system. Ensure to include only the section from
-----BEGIN PRIVATE KEY-----
to-----END PRIVATE KEY-----
.In the Key operations permitted section, select the required operations to define the actions that can be performed with the cryptographic keys, such as encryption, decryption, signing, and verifying.
Click IMPORT to create the new security object.
7.4 Re-importing the Certificate and Map to Fortanix DSM Key
Perform the following steps to reimport the certificate and map it to Fortanix DSM key:
In MMC, import the extracted certificate (without the private key). Right-click Certificates → Personal → Certificates, select All Tasks → Import, and select the
.crt
file.Figure 26: Import certificate to personal store
Repeat the import under Trusted Root Certification Authorities and any other store where the certificate was originally located.
Figure 27: Import certificate to trusted root
Run the following command to list the certificates and note the serial number of the root CA certificate:
certutil -store my
Figure 28: Get certificate serial using certutil
Run the following command to map the certificate to the imported private key in Fortanix DSM:
certutil -repairstore my <SerialNumber>
Replace
<SerialNumber>
with the actual serial number. When prompted, select the key previously imported to Fortanix DSM. For example, MCADCS-Pvt-Key.Figure 29: Map certificate to DSM key
7.5 Reinstalling and Reconfiguring CA
Perform the following steps to reinstall and reconfigure the CA:
Open Server Manager and select Add Roles and Features. Add the ADCS role and proceed with the installation.
After installation, launch the configuration wizard. Under Role Services, select Certification Authority.
Set the Setup Type to Standalone CA and the CA Type to Root CA.
Select the option to use an existing private key and select the previously imported certificate when it appears.
Figure 30: Use existing key in setup
Figure 31: Select imported certificate
7.6 Restoring and Verifying CA Database
After completing the setup, run the following command to restore the original CA database:
certutil -restoredb <BackupDirectory>
To verify the configuration, sign a test CSR and confirm that the certificate is signed using the Fortanix DSM-managed private key.

Figure 32: Verify DSM certificate signing