I have a certificate generated via MakeCert. I want to use this certificate for WCF message security using PeerTrust. How can I programmatically install the certificate into the "trusted people" local machine certificate store using c# or .NET?
I have a CER file, but can also create a PFX.
I believe that this is correct:
using (X509Store store = new X509Store(StoreName.TrustedPeople, StoreLocation.LocalMachine)) { store.Open(OpenFlags.ReadWrite); store.Add(cert); //where cert is an X509Certificate object }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With