相关疑难解决方法(0)

在Root中插入证书(带私钥),LocalMachine证书存储在.NET 4中失败

我在localmachine的根证书存储中插入带有私钥的新CA证书时遇到问题.

这是发生的事情:

//This doesn't help either.
new StorePermission (PermissionState.Unrestricted) { Flags = StorePermissionFlags.AddToStore }.Assert();
var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);
privkey.PersistKeyInCsp = true;
//This shouldn't be necessary doesn't make a difference what so ever.
RSACryptoServiceProvider.UseMachineKeyStore = true;
cert.PrivateKey = privkey;
store.Open (OpenFlags.MaxAllowed);
store.Add (cert);
store.Close ();
Run Code Online (Sandbox Code Playgroud)

证书被插入,它看起来都很花哨:(见!) 请注意它说它有一个私钥

注意:据说它有一个私钥.

所以你会说用FindPrivateKey可以找到它

C:\Users\Administrator\Desktop>FindPrivateKey.exe Root LocalMachine -t "54 11 b1 f4 31 99 19 d3 5a f0 5f 01 95 fc aa 6f 71 12 13 eb"
FindPrivateKey failed for the following …
Run Code Online (Sandbox Code Playgroud)

c# bouncycastle certificate .net-4.0 x509certificate

17
推荐指数
2
解决办法
2万
查看次数