今天热门
热点:

IIS7 在使用RSA加密时出现“只有在 Safe handle 未关闭并且 ref count 为 1 时,才能设置 Safe handle 的句柄字段”错误,iis7.0


问题IIS7 在使用RSA加密时出现“只有在 Safe handle 未关闭并且 ref count 为 1 时,才能设置 Safe handle 的句柄字段。”错误。

错误消息:只有在 Safe handle 未关闭并且 ref count 为 1 时,才能设置 Safe handle 的句柄字段。
错误源:mscorlib
错误栈:   在 System.Security.Cryptography.Utils._ImportKey(SafeProvHandle hCSP, Int32 keyNumber, CspProviderFlags flags, Object cspObject, SafeKeyHandle& hKey)
   在 System.Security.Cryptography.RSACryptoServiceProvider.ImportParameters(RSAParameters parameters)
   在 System.Security.Cryptography.RSA.FromXmlString(String xmlString)
   在 SS01SDS.Tools.Encryptor.Decrypt(Byte[] rgb) 位置 I:\SS01SDS\dev\CommComp\SS01SDS.Tools\Encryptor.cs:行号 60
   在 SS01SDS.Tools.ValidateAuthority.Validate(String CertFilePath) 位置 I:\SS01SDS\dev\CommComp\SS01SDS.Tools\Signature.cs:行号 311
   在 SS01SDS.Webs.Global.Application_BeginRequest(Object sender, EventArgs e) 位置 I:\SS01SDS\dev\CommComp\SS01SDS.Webs\Global.asax.cs:行号 85
附加消息:在验证证书时。


解决方案

问题太过于抽象了,请贴出相关代码以便分析。

出现这个错误是因为 hCSP 这个安全句柄已被 Windows 关闭,或者是无效句柄。原因可能是证书提供商无效,或导入证书失败。

提供更详细的信息有助于我们分析问题。

www.zrccd.nettrue/topics/20180113/67887.htmlTechArticleIIS7 在使用RSA加密时出现“只有在 Safe handle 未关闭并且 ref count 为 1 时,才能设置 Safe handle 的句柄字段”错误,iis7.0 IIS7 在使用RSA加密时出现只有在 Safe handle 未关闭并且 ref count 为 1 时...

相关文章

    暂无相关文章

用户评论

大家都在看