Follow all of these steps carefully to convert your .PFX (p12) certificate to a .pvk + .spc combination on Windows®
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.
The PFX password will be asked.
The PFX password will be asked.
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: http://www.microsoft.com/downloads/details.aspx?FamilyID=f9992c94-b129-4... 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.
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.
To sign the files using the Visual Basic Editor: