16
votes

I'd like to create a new X.509 certificate in .NET, that meet the hash algorithm and key length requirements that I set. This will be a self-signed certificate. Creating a new certificate may create a new key, or perhaps I'd like to import an existing private key that I have in byte[] form.

Does anyone know how to do it?

1
See stackoverflow.com/a/37563051/3063273 for a solution that uses Bouncy Castle - Matt Thomas

1 Answers

6
votes

Maybe this post can be helpful. I use this code in our test environment to create self signed certificates.

Best