java.lang.Object
org.miaixz.bus.shade.safety.boot.jar.Jar

public class Jar extends Object
普通JAR包加解密工具类
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • Jar

      public Jar()
  • Method Details

    • encrypt

      public static void encrypt(String src, String dest, Key key) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      key - 密钥
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, Key key, int mode) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      key - 密钥
      mode - 加密模式
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, Key key) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      key - 密钥
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, Key key, int mode) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      key - 密钥
      mode - 加密模式
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, Key key) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      key - 密钥
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, Key key, int mode) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      key - 密钥
      mode - 加密模式
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, Key key, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      key - 密钥
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, Key key, int mode, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      key - 密钥
      mode - 加密模式
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, Key key, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      key - 密钥
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, Key key, int mode, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      key - 密钥
      mode - 加密模式
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, Key key, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      key - 密钥
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, Key key, int mode, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      key - 密钥
      mode - 加密模式
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, String password) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, String password, String algorithm) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, String password, String algorithm, int keysize) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, String password, String algorithm, int keysize, int ivsize) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, String password) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, String password, String algorithm) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, String password, String algorithm, int keysize) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, String password, String algorithm, int keysize, int ivsize) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, String password) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      password - 密码
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, String password, String algorithm) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      password - 密码
      algorithm - 加密算法
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, String password, String algorithm, int keysize) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, String password, String algorithm, int keysize, int ivsize) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, String password, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, String password, String algorithm, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, String password, String algorithm, int keysize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(String src, String dest, String password, String algorithm, int keysize, int ivsize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, String password, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, String password, String algorithm, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, String password, String algorithm, int keysize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(File src, File dest, String password, String algorithm, int keysize, int ivsize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      src - 原文包
      dest - 加密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, String password, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      password - 密码
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, String password, String algorithm, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      password - 密码
      algorithm - 加密算法
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, String password, String algorithm, int keysize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • encrypt

      public static void encrypt(InputStream in, OutputStream out, String password, String algorithm, int keysize, int ivsize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      加密 普通 JAR 包
      Parameters:
      in - 原文包输入流
      out - 加密包输出流
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      filter - 过滤器
      Throws:
      Exception - 加密异常
    • decrypt

      public static void decrypt(String src, String dest, Key key) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      key - 密钥
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(File src, File dest, Key key) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      key - 密钥
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(InputStream in, OutputStream out, Key key) throws Exception
      解密 普通 JAR 包
      Parameters:
      in - 加密包输入流
      out - 解密包输出流
      key - 密钥
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(String src, String dest, Key key, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      key - 密钥
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(File src, File dest, Key key, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      key - 密钥
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(InputStream in, OutputStream out, Key key, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      in - 加密包输入流
      out - 解密包输出流
      key - 密钥
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(String src, String dest, String password) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(String src, String dest, String password, String algorithm) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(String src, String dest, String password, String algorithm, int keysize) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(String src, String dest, String password, String algorithm, int keysize, int ivsize) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(File src, File dest, String password) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(File src, File dest, String password, String algorithm) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(File src, File dest, String password, String algorithm, int keysize) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(File src, File dest, String password, String algorithm, int keysize, int ivsize) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(InputStream in, OutputStream out, String password) throws Exception
      解密 普通 JAR 包
      Parameters:
      in - 加密包输入流
      out - 解密包输出流
      password - 密码
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(InputStream in, OutputStream out, String password, String algorithm) throws Exception
      解密 普通 JAR 包
      Parameters:
      in - 加密包输入流
      out - 解密包输出流
      password - 密码
      algorithm - 加密算法
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(InputStream in, OutputStream out, String password, String algorithm, int keysize) throws Exception
      解密 普通 JAR 包
      Parameters:
      in - 加密包输入流
      out - 解密包输出流
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(InputStream in, OutputStream out, String password, String algorithm, int keysize, int ivsize) throws Exception
      解密 普通 JAR 包
      Parameters:
      in - 加密包输入流
      out - 解密包输出流
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(String src, String dest, String password, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(String src, String dest, String password, String algorithm, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(String src, String dest, String password, String algorithm, int keysize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(String src, String dest, String password, String algorithm, int keysize, int ivsize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(File src, File dest, String password, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(File src, File dest, String password, String algorithm, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(File src, File dest, String password, String algorithm, int keysize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(File src, File dest, String password, String algorithm, int keysize, int ivsize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      src - 加密包
      dest - 解密包
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(InputStream in, OutputStream out, String password, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      in - 加密包输入流
      out - 解密包输出流
      password - 密码
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(InputStream in, OutputStream out, String password, String algorithm, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      in - 加密包输入流
      out - 解密包输出流
      password - 密码
      algorithm - 加密算法
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(InputStream in, OutputStream out, String password, String algorithm, int keysize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      in - 加密包输入流
      out - 解密包输出流
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      filter - 过滤器
      Throws:
      Exception - 解密异常
    • decrypt

      public static void decrypt(InputStream in, OutputStream out, String password, String algorithm, int keysize, int ivsize, Complex<org.apache.commons.compress.archivers.jar.JarArchiveEntry> filter) throws Exception
      解密 普通 JAR 包
      Parameters:
      in - 加密包输入流
      out - 解密包输出流
      password - 密码
      algorithm - 加密算法
      keysize - 密钥长度
      ivsize - 向量长度
      filter - 过滤器
      Throws:
      Exception - 解密异常