-2

i have purcahsed and installed a SSL certificate from a CA. Now I want to

  1. Get the certificates private key in a c# program to decrypt incoming message.

How do I programmatically access the exact certificate installed on my web server. There seem to be many installed there.

MethodToChaos
  • 335
  • 2
  • 17
  • 1
    Threads like https://stackoverflow.com/questions/11115511/how-to-find-certificate-by-its-thumbprint-in-c-sharp already cover that. – Lex Li May 26 '21 at 15:14

1 Answers1

0

This code does it. I was stuck at what exact attribute to use for the search. 'Subject' workd just fine.

https://www.codeguru.com/columns/dotnet/using-self-signed-certificates-to-encrypt-text.html

MethodToChaos
  • 335
  • 2
  • 17