title: Decrypt AES encrypted file in java
body: <p>I have a file encrypted with java application using AES. I also have a key file was encrypted with. But i can't understand how to use the key to decrypt file. Most tutorials and examples create temporary random key, encrypt file and decrypt it in one place.
  So, question is <strong>how to specify a key which have to be used for decryption?</strong></p>
  
  <p><strong>EDIT</strong>: 
  Samples i found use following code to generate key. I have no idea where i can use my key here.</p>
  
  <pre><code>KeyGenerator kgen = KeyGenerator.getInstance("AES");
  kgen.init(128);
  SecretKey key = kgen.generateKey();
  </code></pre>