为SAML签名和加密创建x509.v3自签名证书,Windows 8 R2

时间:2013-07-25 19:44:30

标签: xml windows saml self-signed x509certificate2

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

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

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签名和加密的自签名证书吗?

1 个答案:

答案 0 :(得分:3)

这需要在localmachine Trusted Root Certifying Authority中创建一个Certifying Authority,然后使用它来签署应用程序使用的证书。

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

相关问题