类 RsaUtils

java.lang.Object
com.cdkjframework.util.encrypts.RsaUtils

@Component public class RsaUtils extends Object
  • 字段详细资料

    • KEY_ALGORITHM

      public static final String KEY_ALGORITHM
      非对称密钥算法
      另请参阅:
  • 构造器详细资料

    • RsaUtils

      public RsaUtils()
  • 方法详细资料

    • encryptPrivateKey

      public static byte[] encryptPrivateKey(byte[] data, byte[] key) throws Exception
      私钥加密
      参数:
      data - 待加密数据
      key - 密钥
      返回:
      byte[] 加密数据
      抛出:
      Exception
    • encryptPublicKey

      public static byte[] encryptPublicKey(byte[] data, byte[] key) throws Exception
      公钥加密
      参数:
      data - 待加密数据
      key - 密钥
      返回:
      byte[] 加密数据
      抛出:
      Exception
    • decryptPrivateKey

      public static byte[] decryptPrivateKey(byte[] data, byte[] key) throws Exception
      私钥解密
      参数:
      data - 待解密数据
      key - 密钥
      返回:
      byte[] 解密数据
      抛出:
      Exception
    • decryptPublicKey

      public static byte[] decryptPublicKey(byte[] data) throws Exception
      公钥解密
      参数:
      data - 待解密数据
      返回:
      byte[] 解密数据
      抛出:
      Exception