【发布时间】:2017-10-13 11:26:22
【问题描述】:
我在 C#.NET 中开发了一个 Windows 服务应用程序,现在尝试从这个用 Java 开发的 Windows 服务调用 Web 服务。我的客户向我提供了 .cert 类型的证书和 .pkcs8 类型的私钥。当我尝试调用 Web 服务时,我收到以下错误:
X.509 证书中不存在私钥。
这是我连接 wsdl 的代码:
<clientCredentials>
<serviceCertificate>
<authentication certificateValidationMode="PeerTrust" trustedStoreLocation="CurrentUser" />
</serviceCertificate>
<clientCertificate storeLocation="CurrentUser" storeName="Root" findValue="176455DB76886FF2BA3C122F8B36322F647CB2FD" x509FindType="FindByThumbprint"/>
</clientCredentials>
如果您能在上面建议我了解如何在此证书中包含私钥以从我的代码中调用 Web 服务,我将不胜感激。 提前致谢。
【问题讨论】:
-
你能给我们看一个调用部分吗?
-
使用 OpenSSL 将证书及其私钥合并到 PFX 文件中。然后将其导入您的证书存储。目前您只导入了触发错误的证书。
标签: c# ssl x509certificate private-key