Hi I am trying to remove the header and footer off a public key that is being stored as a string. I have managed to work out how to remove the "begin" header by removing everything up to the first "\n",
-----BEGIN PUBLIC KEY-----\n
with this code.
String s1 = pKey.substring(pKey.indexOf("\n")+1);
I am however struggling to remove the footer from the end up to the last "\n".
\n-----END PUBLIC KEY-----
There must be a cleaner way to remove them both.