I have a weird problem...
Basing my solution on Decrypting a hardcoded file as byte[]
So, I wrote a small Cypher class to help out with crypting/decrypting..
I think the problem is here:
//opentext
System.out.println("checking PEM...");
crypted = Base64Coder.encode(getBytesFromFile(cryptoPEM));
Previously, you wrote char[] to the file, but now you're reading a byte[] from the file and re-encoding in base64. The file's contents should already be base64-encoded!
You need a new function called getCharsFromFile that returns char[] or String and pass that directly to decrypt2.