Convert .pfx (p12) certificate to a .pvk + .spc

Steps required to convert .pfx (p12) to .pvk + .spc

Follow all of these steps carefully to convert your .PFX (p12) certificate to a .pvk + .spc combination on Windows®

Microsoft® Wizard

Use the Microsoft® export wizard with the following options:

Note: If you are running Windows® you may download OpenSSL here. Otherwise, you can find compiled binaries directly from the OpenSSL website or consult your Operating System's package management feature.

Extracting the private key

The PFX password will be asked.

The PFX password will be asked.

Using the Microsoft® Authenticode® Certificate

In order to use the Microsoft® Authenticode® Certificate to sign VBA projects you will need to import the .pvk and .spc file into your registry using a tool called pvkimprt and then export the keys as a .pfx file which you can import into your browser, this will then allow you to add the signature to the VBA Macros using the Visual Basic editor.

To download pvkimprt.exe directly from Microsoft®, see the following url: or download it from here.

The pvkimprt.exe is a self extracting file, with the same name as the tool you will use to import the files. Make sure you install the file before running the pvkimprt command.

Importing the files

To import the files using pvkimprt.exe, you must reference the full path for your .spc and .pvk files.

You will then be prompted for the Private Key password you specified when you generated the Private Key file.

Signing with the Vidual Basic Editor

To sign the files using the Visual Basic Editor: