title: Define a key to generate keys
body: <p>I'm making a project about security in Java. The Server receives a password and with this password is supposed to insert in MAC to verify the consistency of one specific file.</p>
  
  <pre><code>Mac m;
  SecretKey sk;
  sk = KeyGenerator.getInstance( "AES" ).keygenerator();/* what i don't want to use */
  byte[]mac=null;
  Mac m = Mac.getInstance("HmacSHA1");
  m.init( password ); /* it's wrong */
  m.update("work of security".getBytes());
  mac = m.doFinal();
  </code></pre>
  
  <p>What I can understand is how to define a <code>SecretKey</code> to MAC init...</p>