I am using in my app RSA cryptography. To store generated public key I convert it to String and then save it in database.
Key publicKey=null; Key pri
I can only assume the line:
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(clear);
with "clear" was meant to be "keyBytes"