tags:

views:

111

answers:

1

Using the OpenSSL libraries one can create a CSR (certificate signing request) by doing this:

openssl genrsa -out rsa.key 1024
openssl req -new -key rsa.key -out output.csr -config config.txt

where config.txt contains the distinguished name to use in the certificate.

I would like to do something similar under Windows using C#. However, the method createPKCS10 does not require you to supply an RSA key.

Is there a way to get C# to generate an explicit RSA private key and then use that private key to create the CSR?

A: 

It seem to me you will find the answer on your question here: http://msdn.microsoft.com/en-us/library/ms867026.aspx.

Look at http://stackoverflow.com/questions/2830659/reading-a-certificate-signing-request-with-c/2830857#2830857 for a close question.

Oleg