Tag Archives: certificate

How to Create a PFX Certificate

If you are working with Azure cloud or any other services that require a PFX certificate, here is an easy way to create a certificate.

Step 01
Create vs.bat as below

Be sure to replace that with a path valid for your system, of course. Alternatively, skip this step and instead open up a visual studio command prompt.

Step 02
Create pfx.bat as below

Step 03

  • Open a command prompt (Run > cmd) and cd to the folder where above batch files were created
  • Run vs.bat with no parameters
  • Run pfx.bat <pfx-file-name> <cert-name> <pfx-password>
    • pfx-file-name: Name of the certificate file (say, mypfx). Any valid file name, without spaces.
    • cert-name: Name of the certificate (say, MyApplicationCertificate), without spaces
    • pfx-password: Password for the PFX. This is different from the PVK password that you will be prompted for.

Note that the “without spaces” restriction is due to limitations of the batch file that I’ve done in a hurry. If you wish to have spaces, either use the commands directly or improve the batch file.