I have a small problem to change the type from byte[] to String and then from String to byte[]. When I use my code, it returns the RSA error "Too much data for rsa block". But when I use the original byte[], it works fine.
This is how it works:
cipherData = cipher.doFinal(cipherData);
I tried to change the data type:
// Byte[] to String
String encrypted = new String(cipherData, "UTF-8");
// RSA Operation
cipherData = cipher.doFinal(encrypted.getBytes());
String encrypted = new String(cipherData, "UTF-8")is not going to have any effect on the linecipherData = cipher.doFinal(cipherData).encrypted.getBytes("UTF-8")?