https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn771627(v=ws.11)

 

Migrating a Certification Authority Key from a Cryptographic Service Provider (CSP) to a Key Storage Provider (KSP)

 

  1. Optional: Change the CA hash algorithm to SHA-2:

Note


This step is optional but recommended if your CA is using SHA-1 (or another, older hash algorithm) and requesting devices support the more secure SHA-2 algorithm. It might also be required to comply with the SHA-1 depreciation policy that is documented in the SHA1 Deprecation Policy post on the Windows PKI blog.

 
  - On the CA, in a Command Prompt window, run the following command:

    ``` 
    certutil -setreg ca\csp\CNGHashAlgorithm   
    ```

    For example: **certutil -setreg ca\csp\CNGHashAlgorithm SHA256**
  1. Start the CA service by running the following command in a PowerShell session:

    Start-service certsvc  
    

Repeat these steps on all CAs in your environment that you want to migrate:

  • For subordinate CAs: You will not see this migration take effect on the CA certificate until you migrate the parent CA, and then renew the certificate for the subordinate CA.

  • For a root CA: You will not see the migration take effect for the CA certificate until you migrate the root CA, and then renew the certificate for the root CA.

Validating the new settings

These steps are optional but recommended so that you can validate the new settings are operational before the CA issues new certificates for production use.

To verify that CA service is up and ready to receive requests
  • Run the following command in a Command Prompt window on the CA:

     
  • Certutil –ping  
    

A successful response is CertUtil: -CRL command completed successfully

To verify that the CA is configured for the correct key and provider
  • In a Command Prompt window, run the following command on the CA:

     
  • Certutil –store my   
    

A successful response will include the line Provider = Microsoft Software Key Storage Provider

To verify that the certificate shows the correct signature algorithm and signature hash algorithm
  • Request and issue a certificate for a user or computer and inspect the resulting certificate details.

View the certificate by using the Certificates MMC snap-in and click the Details tab. The Signature algorithm and Signature hash algorithm should show the correct values for your CA configuration.

If you are using a standalone CA and the Certreq.exe command-line tool to request and retrieve the certificate, you can also use a Certutil command to view and validate the correct signing and hash algorithms. For example: Certutil issuedCert.cer | findstr /spi algorithm

To verify that the certificate revocation list publishes and has the correct signature algorithm and signature hash algorithm
  1. Publish the certificate revocation list (CRL) by running the following command from a Command Prompt window on the CA:

     
  • Certutil –crl  
    
  • Locate the CRL file (%windir%\system32\CertSrv\CertEnroll) and then run the following command:

     
  1. Certutil [CAName].crl | findstr /spi algorithm  
    

A successful publication displays the message: CertUtil: -CRL command completed successfully.

When you run the second command, confirm that the Algorithm ObjectId value is the correct hash algorithm for your CA by using the following table:

Algorithm ObjectId CA Signature Algorithm CA Hash Algorithm
sha1RSA RSA SHA-1
sha256RSA RSA SHA-256

As an example, this output confirms the CA is using SHA-256:

Signature Algorithm:

Algorithm ObjectId: 1.2.840.113549.1.1.11 sha256RSA