How can I generate a .pfx file?

Is there a way to create .pfx files for signing documents, I found a program called x509 Certificate Generate, but I want to know if it can be generated in code using C #.

+6
source share
5 answers

There is a Microsoft makecert command line tool that you can use to create certificates. This is part of the Windows SDK. There are half a dozen versions on my machine, for example. in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64 . Then in your code, you can start the process to run the executable file with the appropriate parameters.

+5
source

You can check out the Bouncy Castle API , it can be used to create certificates using C #.

+3
source

First of all, signing documents with self-signed certificates does not make sense if you do not have a custom PKI hierarchy in your organization (and in the latter case, you need to know well what you are doing, which seems to be wrong),

PFX is a container for one or more certificates with associated private keys. This way you are not creating a "PFX file". You create a key pair and create a certificate, which can then be exported to a PFX file or to another format.

As mentioned above, BouncyCastle can create certificates, and our SecureBlackbox library can also create certificates and save and upload them to / from different formats.

+3
source

If you read about the makecert referenced by @David Clarke's answer, you will see that you have met your requirement, you just need a managed makecert written in .NET.

Luckily, the Mono guys have implemented this a long time ago,

https://github.com/mono/mono/blob/master/mcs/tools/security/makecert.cs

0
source

You can digitally sign up using adobe reader

if you use adobe x then go to the 3rd option on the left - you can see the subscription settings - open it and go on to add an identifier Just enter your details and you're done. The ppx file is ready, wherever you look at it ... - valid for 6 years

0
source

Source: https://habr.com/ru/post/906357/


All Articles