If I generate a key like this:
SecretKey aesKey = KeyGenerator.getInstance("AES").generateKey();
Then decode it:
System.out.println("used key: " + aesKlic.getEncoded());
And now I want to use it for decryption(after exiting program and starting again). Obviously, something like this does not work:
SecretKey aesKey = javax.crypto.spec.SecretKeySpec@[B@6c6e70c7;
if the string at the end is decoded key.