I\'ve seen a number of similar questions, but nothing has quite worked for me. I am simply trying to convert an RSA public key that\'s in PEM format that I\'ve retrieved from a
To answer my own question...The first output is in hex and the second output is in base 64. Just change the return statement to return new String(Base64.encode(encryptedBytes));
and you'll be good!