Have a look at the System.Security.Cryptography.X509Certificates
namespace.
Notably, the X509Store
class will do at least one of the things you're referring to: Importing an existing certificate into the store. e.g.
X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);try{ store.Open(OpenFlags.ReadWrite); store.Add( new X509Certificate2(@"Certificates\MyCertificate.pfx", "password"));}finally{ store.Close();}
See also:
On one of your other parts, creating a certificate, I found this: makecert.cs: makecert clone tool ... if you're not going to call out to a console tool like makecert.exe
, you'll likely end up implementing something similar to that.