1

我编写了一个应用程序来生成用于 SSO 的 SAML2 令牌。它使用 System.Security.Cryptography.X509Certificates 对 XML 进行签名并加密断言。

我们将为我们的生产环境购买证书,但现在我需要使用自创证书从我们的集成服务器进行测试。我使用 MakeCert 创建了一个并将其加载到 My Store 中的 LocalMachine 位置。这在我是本地主机时有效,但在远程访问时会出现以下错误:

The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation.

  System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) +369
   System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle) +151
   System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair() +85
   System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) +280
   System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey() +468
....

我已经下载了 winhttpcertcfg 并使用它来提供用于站点(SharePoint2010)的应用程序池的域帐户,并为 NetworkService 提供对证书的访问权限,但这没有效果。

任何人都可以向我指出一个资源,该资源解释了如何在 Windows 8 中正确创建和实施用于 XML 签名和加密的自签名证书?

4

1 回答 1

3

这需要创建一个安装在本地机器受信任的根证书颁发机构中的证书颁发机构,然后使用它来签署应用程序使用的证书。

此链接提供了允许我完成此操作的详细信息:http ://www.digitallycreated.net/Blog/38/using-makecert-to-create-certificates-for-development

于 2013-07-26T13:06:38.297 回答