static string RSAEncrypt(string xmlPublicKey, string m_strEncryptString) { RSACryptoServiceProvider provider = new RSACryptoServiceProvider(); provider.FromXmlString(xmlPublicKey); byte[] bytes = new UnicodeEncoding().GetBytes(m_strEncryptString); return Convert.ToBase64String(provider.Encrypt(bytes, false)); } 密鑰是 是 證書中獲取的 xml 最后加密的時候 報 不正確的長度 。
- 1 回答
- 0 關注
- 1676 瀏覽
添加回答
舉報
0/150
提交
取消