Web程序里用 RSA 加密,私钥和公钥都放在程序里写死了,但是在运行的时候,会出现System.Security.Cryptography.CryptographicException 异常,导致IIS重启。
有的客户端正常,小部分客户端导致该错误,请教该异常由何引发,如何处理啊?
错误全部信息:
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/1457996989/Root
Process ID: 9652
Exception: System.Security.Cryptography.CryptographicException
Message: Keyset does not exist
StackTrace: at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
at System.Security.Cryptography.SafeKeyHandle._FreeHKey(IntPtr pKeyCtx)
at System.Security.Cryptography.SafeKeyHandle.ReleaseHandle()
at System.Runtime.InteropServices.SafeHandle.InternalFinalize()
at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
at System.Runtime.InteropServices.SafeHandle.Finalize()
*****************************************
本内容使用
CSDN小秘书回复
每天回帖即可得10分可用分!
*****************************************