title: convert Byte Array to Secret Key
body: <p>I've been trying to convert a byte array to its original SecretKey, but I've no more ideas left. The most promising attempt was this one:</p>
  
  <pre><code>byte[] encodedKey     = Base64.decode(stringKey);
  SecretKey originalKey = SecretKeySpec(encodedKey, 0, encodedKey.length, "AES")
  </code></pre>
  
  <p>found here: <a href="https://stackoverflow.com/questions/5355466/converting-secret-key-into-a-string-and-vice-versa">Converting Secret Key into a String and Vice Versa</a></p>
  
  <p>I'm using the import javax.crypto.spec.SecretKeySpec, so the constructor for SecretKeySpec should be used correctly, at least referring to <a href="http://docs.oracle.com/javase/1.5.0/docs/api/javax/crypto/spec/SecretKeySpec.html" rel="noreferrer">http://docs.oracle.com/javase/1.5.0/docs/api/javax/crypto/spec/SecretKeySpec.html</a>. </p>
  
  <p>Nonetheless I always get "The Method SecretKeySpec is undefined for ... [Class Name]" - which I just don't get. </p>
  
  <p>I'm guessing it's just some minor mistake, but I just can't figure it out. Can someone please help me out here? </p>