public static byte[] initKey() throws Exception{
		//密钥生成器
		KeyGenerator keyGen = KeyGenerator.getInstance("AES");
		//初始化密钥生成器
		keyGen.init(128);  //默认128，获得无政策权限后可用192或256
		//生成密钥
		SecretKey secretKey = keyGen.generateKey();
		return secretKey.getEncoded();
	}
public static byte [ ] initKey ( ) throws Exception { KeyGenerator keyGen = KeyGenerator . getInstance ( "AES" ) ; keyGen . init ( 128 ) ; SecretKey secretKey = keyGen . generateKey ( ) ; return secretKey . getEncoded ( ) ; }
生成密钥
@throws Exception