EncryptTool { public static SecretKey generateDataEncryptionKey() throws Exception { String jceAlgorithmName = "AES"; KeyGenerator keyGenerator = KeyGenerator.getInstance(jceAlgorithmName); keyGenerator.init(128); return keyGenerator.generateKey(); }  static SecretKey generateKeyEncryptionKey(); static SecretKey generateDataEncryptionKey();  }
@Test public void testGenerateDataEncryptionKey() throws Exception { assertEquals(EncryptTool.generateDataEncryptionKey().getClass().getName(),"javax.crypto.spec.SecretKeySpec"); }