public static String unwrap(String cipherText,String key){
  byte[] dataToDecrypt=Base64.decodeBase64(cipherText.getBytes());
  byte[] iv=new byte[16];
  byte[] data=new byte[dataToDecrypt.length - 16];
  System.arraycopy(dataToDecrypt,0,iv,0,16);
  System.arraycopy(dataToDecrypt,16,data,0,dataToDecrypt.length - 16);
  byte[] plainText=decrypt(data,key,iv);
  return new String(plainText);
}

public static String unwrap ( String cipherText , String key ) { byte [ ] dataToDecrypt = Base64 . decodeBase64 ( cipherText . getBytes ( ) ) ; byte [ ] iv = new byte [ 16 ] ; byte [ ] data = new byte [ dataToDecrypt . length - 16 ] ; System . arraycopy ( dataToDecrypt , 0 , iv , 0 , 16 ) ; System . arraycopy ( dataToDecrypt , 16 , data , 0 , dataToDecrypt . length - 16 ) ; byte [ ] plainText = decrypt ( data , key , iv ) ; return new String ( plainText ) ; }
decrypt a string with given key .
