title: AES Key encoded byte[] to String and back to byte[]
body: <p>In the similar question <a href="https://stackoverflow.com/questions/2758654/conversion-of-byte-into-a-string-and-then-back-to-a-byte">"Conversion of byte[] into a String and then back to a byte[]"</a> is said to not to do the byte[] to String and back conversion, what looks like apply to most cases, mainly when you don't know the encoding used.</p>
  
  <p>But, in my case I'm trying to save to a DB the javax.crypto.SecretKey data, and recoverd it after.</p>
  
  <p>The interface provide a method getEncoded() which returns the key data encoded as byte[], and with another class I can use this byte[] to recover the key.</p>
  
  <p>So, the question is, how do I write the key bytes as String, and later get back the byte[] to regenerate the key?</p>