Here you can find the source of getAesKey(String key)
private static SecretKeySpec getAesKey(String key)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import javax.crypto.spec.SecretKeySpec; import javax.xml.bind.DatatypeConverter; public class Main { private static SecretKeySpec getAesKey(String key) { final byte[] symKeyData = DatatypeConverter.parseHexBinary(key); return new SecretKeySpec(symKeyData, "AES"); }/*from w w w . j av a 2s .c o m*/ }