在LocalMachine存储或CurrentUser存储中找不到证书 [英] Cannot find the certificate in either the LocalMachine store or the CurrentUser store

查看:410
本文介绍了在LocalMachine存储或CurrentUser存储中找不到证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在用户PC中安装了 ssl证书。而且,我还将该证书导入到 受信任的根证书颁发机构的本地计算机下。我正在尝试使用网络服务。在我的代码中,我将证书附加如下。

  webservice.ClientCertificates.Add(X509Certificate.CreateFromCertFile(certPath)); 

但是我遇到了以下错误。


在LocalMachine商店或CurrentUser商店中找不到证书


可能是什么问题?我正在使用.Net Framework 2.0。因此,无法使用WCF。谢谢。

解决方案

这意味着




  • 可能是您安装了错误的证书。

  • 您将证书安装到了错误的位置。




  1. 启动IE即可。

  2. 判断是否已正确安装客户端证书的简单方法。 >打开工具| Internet选项。

  3. 在内容选项卡中,单击证书按钮。

然后您应该会看到Personal中的证书(读取证书路径并查看它是否包含错误),并将能够在WinForms应用程序中使用它。


I have already installed the ssl cert in user PC. And, I also imported the cert under Local computer of Trusted Root Certification Authorities. I am trying to consume the web servcie. In my code I attach the cert as below.

webservice.ClientCertificates.Add(X509Certificate.CreateFromCertFile(certPath));

But I got the following error.

Cannot find the certificate in either the LocalMachine store or the CurrentUser store

What could be the issue? I'm using .Net Framework 2.0. So, not able to use WCF. Thanks.

解决方案

That means,

  • probably you have the wrong certificates installed.
  • you installed the certificates to the wrong place.

An easy way to tell if you have a client certificate installed properly is

  1. launch IE.
  2. Open Tools | Internet options.
  3. In Content tab, click Certificates button.

Then you should see the cert in Personal (read cert path and see whether it contains errors), and will be able to use it in your WinForms application.

这篇关于在LocalMachine存储或CurrentUser存储中找不到证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆