How can I generate a .pfx file?

user773456 picture user773456 · Jan 19, 2012 · Viewed 36.2k times · Source

Is there any way to create .pfx files in order to sign documents, I've found a program called x509 Certificate Generate,but I want to know if it can be generated in code using c#.

Answer

David Clarke picture David Clarke · Jan 19, 2012

There is a Microsoft command-line tool makecert that can be used to generate certificates. It's part of the Windows SDK. On my machine there are half a dozen versions e.g. in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64. Then in your code you can start a process to run the executable with the appropriate parameters.