Importing a certificate along with its private key into Windows involves a few steps. Here are the instructions:
- Combine Certificate and Private Key Files:
- First, ensure you have both the certificate (usually in a
.crt
or.pem
file) and the private key (usually in a.key
file). - Rename the private key file to match the certificate file name. For example, if your certificate file is
mycert.pem
, name the private key filemycert.key
. - Place both files in the same folder.
- First, ensure you have both the certificate (usually in a
- Use
certutil.exe
to Create a PFX File:- Open a command prompt.
- Run the following command:
certutil -mergepfx mycert.pem mycert.pfx
Replacemycert.pem
with your certificate file name andmycert.pfx
with the desired output file name for the PFX. - You’ll be prompted to create a password for the PFX file.
- Import the PFX File:
- Navigate to the Personal | Certificates pane in the Certificate Manager (
certmgr.msc
). - Right-click within the Certificates panel and select All Tasks | Import.
- Follow the wizard to import the signed certificate along with the private key.
- Navigate to the Personal | Certificates pane in the Certificate Manager (
You can also use OpenSSL to create PFX, First you will need to install OpenSSL on windows, and you can download it from here : https://slproweb.com/products/Win32OpenSSL.html or from here : http://gnuwin32.sourceforge.net/packages/openssl.htm , then execute this command to create PFX :
openssl pkcs12 -export -in <certificate.crt> -inkey <private.key> -out <output.pfx>
Remember to keep your private key secure and never share it publicly. If you encounter any issues during the process