makecert.exe is a part of Microsoft Windows SDK. If you have Microsoft Visual Studio .NET installed, you can use both the makecert.exe and pvk2pfx.exe tools.


  1. Open the Visual Studio command prompt as an Administrator.
  2. Navigate to the folder where you want to create the certificate files.
  3. To create a certificate and a private key file, run the following command:
    makecert -r -pe -n "CN=HOSTNAME" -eku -sky exchange -sv HOSTNAME.pvk HOSTNAME.cer
  4. To convert the files into a .pfx file, run the following command:
    pvk2pfx -pvk HOSTNAME.pvk -spc HOSTNAME.cer -pfx HOSTNAME.pfx
  5. Deploy the generated SSL certificate to the remote server and import it there.