How to programmatically create an RSA key pair and store in an X509Store

Hello all,
I have been reading documentation and googling for information regarding this question, but I am unable to find the solution.

In C# (.NET v 3.5 or higher) I want to generate an RSA public/private key pair and export it directly into a user X509Store.  Initially I expect that I will create a self-signed certificate for the public key (for import into the key store).  Subsequently to that I will create a certificate request and send it to a CA for signature and then replace the self signed cert in the keystone with the signed cert-chain from the CA.

But so far I cannot find information on how to get a key pair into the keystone.

Thanks for any help.
LVL 1
edcAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

anarki_jimbelSenior DeveloperCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
edcAuthor Commented:
Hi anarki_jimbel,
Thanks very much for your post.  The article gives details about key pair generation and does demonstrate adding a pub/priv key via cert into the MS key store.  Unfortunately the author is quite confused about PKI and is - more or less - writing two different pieces of code in the function - neither one of which work.

Do you have any other resources up your sleeve?

Thanks again.
0
edcAuthor Commented:
Thanks anarki_jimbel.  The link you provided allowed me to do research to get to the answer I was looking for.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.