gpt4 book ai didi

c# - 帮助解决 SAML 错误 : "Keyset does not exist"

转载 作者:行者123 更新时间:2023-11-30 22:39:29 26 4
gpt4 key购买 nike

我们有两个应该相同的环境,但是当我们尝试生成 SAML 消息签名时,其中一个会引发错误。我以前没有看过 SAML,我不确定它试图做什么

部分代码:

X509Certificate2 x509Certificate = (X509Certificate2)Application[ASP.global_asax.IdPX509Certificate];

try
{
SAMLMessageSignature.Generate(samlResponse, x509Certificate.PrivateKey, x509Certificate);
}
catch (Exception ex)
{
app = File.AppendText(@"C:\SAML.txt");
app.WriteLine(ex.Message.ToString());
app.Flush();
app.Close();
}

异常信息是

Keyset does not exist

有人知道我应该看什么吗?

提前致谢。

最佳答案

您好,请检查您的设置。

  • 为您安装的证书设置正确的访问控制条目、ACL。
  • 将 NETWORK SERVICE 的修改访问角色添加到证书。
  • 如果您使用的是 Windows 2008 和 Windows 7,您可以从证书中获取私钥MMC 中的管理单元。

    Manage Private Keys

  • 如果仍然无效,请也为 IIS_IUSRS 添加修改访问角色。 IIS_IUSRS

希望对您有所帮助。

谢谢!

关于c# - 帮助解决 SAML 错误 : "Keyset does not exist",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5691619/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com