我發現下面的代碼將證書安裝到本地機器可信發佈者。但代碼是在C#我想要在C中完成相同。如何將其轉換爲C?C代碼等效於C#來安裝證書
private static void InstallCertificate(string cerFileName)
{
X509Certificate2 certificate = new X509Certificate2(cerFileName);
X509Store store = new X509Store(StoreName.TrustedPublisher,StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadWrite);
store.Add(certificate);
store.Close();
}
是否提供任何Windows APIS?
我發現這個鏈接的代碼http://stackoverflow.com/questions/566570/how-can-i-install-a-certificate-into-the -local-machine-store-programmatically-us?answertab = active#tab-top,我打算用C編程做同樣的事情。 – 2vision2