Take the 2-minute tour ×  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:  byte[] encodedKey
= Base64.decode(stringKey); SecretKey originalKey =
SecretKeySpec(encodedKey, 0, encodedKey.length, "AES")  found
here: Converting Secret Key into a String and Vice Versa  I'm
using the import javax.crypto.spec.SecretKeySpec, so the
constructor for SecretKeySpec should be used correctly, at least
referring to http://docs.oracle.com/javase/1.5.0/docs/api/javax/
crypto/spec/SecretKeySpec.html.  Nonetheless I always get "The
Method SecretKeySpec is undefined for ... [Class Name]" - which
I just don't get.  I'm guessing it's just some minor mistake,
but I just can't figure it out. Can someone please help me out
here?  share|improve this question Do you have a semi-colon at
the end of the constructor? :) –  Jeff Gohlke Jan 7 '13 at 21:36
add comment  1 Answer  up vote 8 down vote accepted  You need to
use the new keyword to call th