cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Runtime Approach for the Installation of Certificate with Private Key Protection (pfx with password)

Runtime Approach for the Installation of Certificate with Private Key Protection (pfx with password)

Summary

Use custom code to install a pfx with a password

Synopsis

Importing a pfx file on the target machine during the installation requires approval. During installation use custom code, PowerShell or a batch file approach involving the Microsoft tool certutil.exe.

Discussion

In some cases a password is required to install a pfx file as part of the payload of your installer package. In the past it may have been possible to use certmgr.exe.

To install a certificate with a password requires authoring custom code to call certutil.exe. Using certutil in this manner requires passing appropriate parameters.

As an example to deliver a password include the '-p' switch and the full command may look like this:

certutil.exe ?f ?p <PFX_password> -importPFX <PFX_file>

-f is expected to force overwrite of certificate
-p is the password of the pfx file
-importPFX imports certificate and private key

Additional Information

For a list of syntax information and examples when managing the Certificate Services, see the Microsoft TechNet library article : Certutil
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jul 18, 2018 09:25 PM
Updated by: