我有個問題與使用RSACryptoServiceProvider.VerifyDataRSACryptoServiceProvider.VerifyData例外管線326
的NullReferenceException:未設置爲一個 對象 的實例System.Security.Cryptography.RSACryptoServiceProvider.VerifyData (對象引用System.Byte []緩衝區,System.Object halg,System.Byte []簽名) (在 /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs:326)
您可以在RSACryptoServiceProvider.cs行中看到異常326 我重複檢查了所有參數並創建了rsa - 一切正常。 有什麼建議嗎?
我的代碼:
X509Certificate2 x509 = null;
RSACryptoServiceProvider rsa = null;
byte[] certificate = Convert.FromBase64String(certificate_s);
x509 = new X509Certificate2(certificate);
rsa = (RSACryptoServiceProvider) x509.PublicKey.Key;
bool sha1Valid = rsa.VerifyData(data, CryptoConfig.MapNameToOID("SHA1"), signature);
哪條線是326?什麼是'certificate_s','data'和'signature'? – 2013-03-04 18:29:20
Unity標籤用於Microsoft Unity。請不要濫用它。 – 2013-03-08 06:54:04