我的 DNN 模块使用我的公钥加密一些数据并将其呈现给用户。用户将此数据提交给我进行处理。我用我的私钥解密数据并使用它。我使用 .Net RSACryptoServiceProvider 进行加密/解密。到目前为止,这一直运作良好。我从客户那里收到了一些数据,当我尝试对其进行解密时会引发错误 -Value cannot be null. Parameter name: rgb
由于加密是在用户的服务器上进行的,我想知道是否有任何环境因素会影响它。我真的不确定如何缩小问题的范围。是什么让相同的代码在不同的服务器上表现不同?
我可以提供所需的任何其他信息。
任何输入表示赞赏。谢谢。
编辑:添加堆栈跟踪
System.ArgumentNullException: Value cannot be null. Parameter name: rgb at System.Security.Cryptography.RSACryptoServiceProvider.Decrypt(Byte[] rgb, Boolean fOAEP) at MyWS.MyMethod(String param1, String EncryptedData, String& errMsg) --- End of inner exception stack trace ---