Here you can find the source of generateKey(byte[] keyBytes)
private static Key generateKey(byte[] keyBytes) throws Exception
//package com.java2s; //License from project: Apache License import javax.crypto.spec.SecretKeySpec; import java.security.Key; public class Main { private static final String AES = "AES"; private static Key generateKey(byte[] keyBytes) throws Exception { return new SecretKeySpec(keyBytes, AES); }//from w w w.j ava 2 s. c o m }