注意:AES加密算法对于不同系统之间的tokens可能会不同,需要在相同的系统间使用
如果设置为private,在其它类调用AES访问不了这个tokens常量,需要自主定义一个tokens或者在配置文件里定义一个tokens,这里的定义将没有意义
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
/**
* description: AES对称加密和解密
* create by: yonyong
* create time: 2019/3/1 18:11
*/
public class AES