1.0 Introduction
This article describes how to migrate a private key from an existing Microsoft Active Directory Certificate Services (AD CS) Certificate Authority (CA) to Fortanix-Data-Security-Manager (DSM).
2.0 Prerequisites
This document assumes that the following features are already enabled and in use:
Microsoft Domain Name System (DNS) server role must be enabled and configured for the server.
Microsoft ADCS server role must be enabled, and the CA must be configured.
3.0 Back-Up Existing CA Certificates
Check the certificates that are issued by the existing Windows CA server. The following figure shows there are five certificates that the CA server has issued so far.

Figure 1: Windows CA server certificates
Back up the existing CA certificate using the following steps:
On the Windows Server where Microsoft AD CS role is installed:
Go to Start.
Find and run
certsrv.msc
.Press Enter to open the Certification Authority window.
Figure 2: Certificate authority
Right-click the CA and in the menu select All Tasks → Back up CA…
Figure 3: Back up CA
In the Certification Authority Backup Wizard, click Next to choose a location to save the certificate and database.
Figure 4: CA backup wizard
Select the check boxes “Private key and CA certificate” and “Certificate database and certificate database log”.
Figure 5: CA backup wizard
Click Next to set the password for the private key. Click Next again and then click Finish. Now the certificate and database backup will be available in the backup location.
4.0 Export the Certificate and Remove it from Trusted Root CA
In this section, you will learn how to export the CA certificate and remove the AD CS role from the server.
4.1 View the Certificates of the Local Computer
Go to Start.
Find and run
mmc
. Press Enter.Figure 6: Run MMC
In the Console window that opens, click the File menu, and select Add/Remove Snap-in.
Figure 7: Add snap-in
From the Available snap-ins section, select Certificates and click Add to configure the certificate.
Figure 8: Configure certificate
In the Certificates snap-in window, select Computer account and click Next.
Figure 9: Manage certificate for computer account
In the Select Computer window, select Local computer that the snap-in will manage. Click Finish.
Figure 10: Select computer
Click OK to close the window.
Figure 11: Certificate snap-in configured
Now you will see all the certificates of the local computer.
Figure 12: Certificates of local computer
4.2 Export the Certificate
Under the Console Root folder in the left panel, click the folder Trusted Root Certification Authorities and click the Certificates folder on the right.
Figure 13: Trusted root CA certificates
From the available certificates, right-click the fortanix-server-CA certificate, and in the menu go to All Tasks and click Export to export the certificate to a local folder. Remove it from the Trusted Root Certification Authorities folder.
Figure 14: Export certificate
Under the Console Root folder in the left panel, select the Personal folder, and delete any available certificates.
4.3 Remove AD CS Role from the Server
To remove the AD CS role:
Go to Server Manager Dashboard.
In the top-right menu, click Manage and select Remove Roles and Features.
Figure 15: Remove roles and features
In the Remove Roles and Features Wizard screen, select Server Roles in the left panel, and clear the checkbox for Active Directory Certificate Services to remove the AD CS role.
Click Next in the following screens to remove the role and feature.
Figure 16: Remove AD CS
Reboot the server.
5.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:
5.1 Signing Up
To get started with the Fortanix Data Security Manager (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.
5.2 Creating an Account
Access the <Your_DSM_Service_URL> on the web browser and enter your credentials to log in to the Fortanix DSM.

Figure 17: Logging In
5.3 Creating a Group
Perform the following steps to create a group in the Fortanix DSM:
Click the Groups menu item in the DSM left navigation bar and click the + button on the Groups page to add a new group.
Figure 18: Add Groups
On the Adding new group page, enter the following details:
Title: Enter a title for your group.
Description (optional): Enter a short description for the group.
Click the SAVE button to create the new group.
The new group has been added to the Fortanix DSM successfully.
5.4 Creating an Application
Perform the following steps to create an application (app) in the Fortanix DSM:
Click the Apps menu item in the DSM left navigation bar and click the + button on the Apps page to add a new app.
Figure 19: Add Application
On the Adding new app page, enter the following details:
App name: Enter the name of your application.
ADD DESCRIPTION (optional): Enter a short description for the application.
Authentication method: Select the default API Key as the method of authentication from the drop down menu. For more information on these authentication methods, refer to User's Guide: Authentication documentation.
Assigning the new app to groups: Select the group created in Section 5.3: Creating a Group from the list.
Click the SAVE button to add the new application.
The new application has been added to the Fortanix DSM successfully.
5.5 Copying the API Key
Perform the following steps to copy the API key from the Fortanix DSM:
Click the Apps menu item in the DSM left navigation bar and click the app created in Section 5.4: Creating an Application to go to the detailed view of the app.
On the INFO tab, click the VIEW API KEY DETAILS button.
From the API Key Details dialog box, copy the API Key of the app to be used it later.
6.0 Configure Certificate Authority
6.1 Import Key in Fortanix DSM
Using the command prompt, open the folder where the private key was saved.
Using OpenSSL command extract the CA key with
.p12
extension to.key
and thenrsa
with.pem
.Click the Security Objects menu item in the DSM left navigation bar and click the + button on the Security Objects to add a security object.
Figure 20: Add Security Object
On the Add New Security Object page, enter the following details:
Security Object name: Enter the name of your security object.
Group: Select the group as created in Section 5.3: Creating a Group.
Select the IMPORT radio button.
Choose a type: Select the RSA key type to import.
Key Size: Indicates the size of the key in bits.
In the Place value here or import from file section, select the value format type as Hex, Base64, or Raw and click the UPLOAD A FILE button to upload the key file.
Key operations permitted: Select the required operations to define the actions that can be performed with the cryptographic keys, such as encryption, decryption, signing, and verifying.
Click the IMPORT button to create the new security object.
Figure 21: Import CA
Install Microsoft CNG Key Storage Provider by following the article here and run the following commands.
You will see activity logs similar to Figure 22.
Figure 22: App authentication activity logs
6.2 Install X.509 Certificate in Local User Trusted Root CA Store
To install the X.509 certificate that was exported in Section 4.2: Export the Certificate in the local user Trusted Root CA Store:
Right-click the certificate and click Install.
Click Next.
Figure 23: Install certificate
Select Place all certificates in the following store and click Browse.
Select Trusted Root Certification Authorities and click Ok.
Figure 24: Select certificate store
Click Next.
Click Finish.
Click Ok to close the import success message.
You will now see the certificate, that is,
fortanix-server-CA
has been successfully imported in the Trusted Root CA.
6.3 Install CA Certificate in the Personal Store
To install the certificate into your store:
Run the following command from the command prompt terminal:
certutil -addstore my <certificate name>
Where
fortanix-server.CA
is the exported certificate in Base-64 encoded X.509 (.CER
)Once you run the command above you can find the exported CA in the Personal Trust Store as shown in Figure 21.
Figure 25: CA installed in personal trust store
You can find the cert serial number from the following command.
certutil -store my
Now repair the certificate store by running the following command from the console.
certutil -f -repairstore -csp "Fortanix KMS CNG Provider" my "<cert serial number>"
The repair operation will not be allowed because the private key is restricted to be exported from Fortanix DSM, protecting the key integrity.
6.4 Add AD CS Role to the Server
Add the AD CS role to the server.
Figure 26: Add AD CS role
Configure AD CS with the following settings:
In the Private Key window, select Use existing private key and then select Select a certificate and use its associated private key.
Figure 27: Configure AD CS
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.
Figure 28: Configure AD CS
In the Certificate Database window click Next.
In the Confirmation window click Configure.
Figure 29: AD CS configuration
When the CA installation is complete, click Close in the installation results window.
You can find the CA configured.
Figure 30: CA configured
Once the CA certificate is successfully configured, you can then check the Fortanix DSM Certificate logs.
Figure 31: Certificate logs
To test the operation, request a certificate from a client machine.
Figure 32: Request a certificate
We are using Certificate Enrollment Web service to request a certificate from a client machine, fill in all the details in the form and click Submit.
Figure 33: Request a certificate
Once the certificate is issued, click Install this certificate.
Figure 34: Certificate issued
Now go back to the CA server to see if the Certificate is issued. We need to use the mmc console again.
Figure 35: Certificate installed
7.0 Restore Issued Certificates
To restore certificates:
Go to the Certificate Authority (CA) service and right-click the CA.
In the menu that opens, click All Tasks → Restore CA.
Figure 36: Restore CA
In the Certification Authority Restore Wizard, click OK to stop the Active Directory Certificate Services.
Figure 37: Stop active directory certificate services
Click Next.
Figure 38: CA restore wizard
In the Items to Restore section, select Certificate database and certificate database log. Enter C:\ directory as the restore location. Click Next.
Figure 39: Items to restore
Click Finish to close the wizard and being the restoration process.
Figure 40: Begin restoration
The CA restoration is completed. Click Yes to start Active Directory Certificate Services.
Figure 41: Restoration complete
The SubCA certificate is restored.
Figure 42: Certificate restored
Any previously issued certificates will be listed.