【发布时间】:2014-07-21 04:15:11
【问题描述】:
我有一个托管在 Windows 服务和控制台主机上的 wcf 服务。 出于某些安全原因,我正在使用证书。
证书已正确安装在客户端计算机上。我同时使用控制台主机(用于测试)和 Windows 服务主机。当我启动控制台主机时,一切看起来都很好,并且我的服务正常工作。
但是,因为我使用 Windows 服务。当我想启动我的服务时,它会出现错误并且不允许服务运行。该错误是我已经修复的。但是,它无缘无故地开始弹出同样的错误。
错误信息:
System.ArgumentException: It is likely that certificate 'CN=CertificateName' may not have a private key that is capable of key exchange or the process may not have access rights for the private key. Please see inner exception for detail. ---> System.Security.Cryptography.CryptographicException: Keyset does not exist
问题是该证书在控制台主机应用程序中运行良好,但它不适用于 Windows 服务。
我应该怎么做才能通过windows服务使用这个证书?
【问题讨论】:
-
我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
-
感谢@JohnSaunders 的注意
标签: c# wcf windows-services wcf-security