string certificateFilePath=@"C:\Documents and Settings\alexander.junior\Desktop\Test.cer"; // Convert the Filename to an X509 Certificate X509Certificate2 cert = new X509Certificate2(certificateFilePath); // Get the server certificate store X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine); store.Open(OpenFlags.MaxAllowed); store.Add(cert); // x509 certificate created from a user supplied filename
X509Store store = new X509Store(StoreName.My, StoreLocation. LocalMachine); store.Open(OpenFlags.ReadWrite); store.Add(new X509Certificate2(X509Certificate2.CreateFromCertFile(certificateFilePath))); store.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)