以下是将pfx添加到Cert存储的代码.
X509Store store = new X509Store( StoreName.My, StoreLocation.LocalMachine );
store.Open( OpenFlags.ReadWrite );
X509Certificate2 cert = new X509Certificate2( "test.pfx", "password" );
store.Add( cert );
store.Close();
Run Code Online (Sandbox Code Playgroud)
但是,我找不到为NetworkService设置访问私钥的权限的方法.
任何人都能解释一下吗?提前致谢.