类 AesUtils

java.lang.Object
cn.zhxu.toys.util.AesUtils

public class AesUtils extends Object
  • 构造器详细资料

    • AesUtils

      public AesUtils(String strKey) throws Exception
      指定密钥构造方法.
      参数:
      strKey - 指定的密钥
      抛出:
      Exception - 异常
  • 方法详细资料

    • encrypt

      public byte[] encrypt(byte[] arr) throws Exception
      加密字节数组.
      参数:
      arr - 需加密的字节数组
      返回:
      加密后的字节数组
      抛出:
      Exception - 异常
    • encrypt

      public String encrypt(String strIn) throws Exception
      加密字符串.
      参数:
      strIn - 需加密的字符串
      返回:
      加密后的字符串
      抛出:
      Exception - 异常
    • decrypt

      public byte[] decrypt(byte[] arr) throws Exception
      解密字节数组.
      参数:
      arr - 需解密的字节数组
      返回:
      解密后的字节数组
      抛出:
      Exception - 异常
    • decrypt

      public String decrypt(String strIn) throws Exception
      解密字符串.
      参数:
      strIn - 需解密的字符串
      返回:
      解密后的字符串
      抛出:
      Exception - 异常
    • main

      public static void main(String[] args) throws Exception
      抛出:
      Exception