java 用RSA解码 .net发送过来的密文 报:Data must start with zero
这是我的代码:
byte[] buffer1 = Base64.decode(data); // 需要解密的数据
tempBuf = m_RSA.decryptData(buffer, m_RSA.decodePrivateKeyFromXml(PrivateKey));
public static byte[] decryptData(byte[] encryptedData, PrivateKey priKey) {
try {
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.DECRYPT_MODE, priKey);
return cipher.doFinal(encryptedData);
查了很多。。可能是base64 解码的问题。。不知如何解决。。求大神赐教!!!!