类 RasUtil


  • public class RasUtil
    extends java.lang.Object
    版本:
    V1.0 , 2020/3/20
    作者:
    三刀
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      private static java.lang.String KEY_ALGORITHM  
      private static int KEY_SIZE  
    • 构造器概要

      构造器 
      构造器 说明
      RasUtil()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static byte[] encryptByPrivateKey​(byte[] data, byte[] key)
      私钥加密
      static byte[] encryptByPrivateKey​(byte[] data, byte[] key, int start, int length)  
      static byte[] getPrivateKey​(java.security.KeyPair keyPair)  
      static byte[] getPublicKey​(java.security.KeyPair keyPair)  
      static java.security.KeyPair initKey()  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • KEY_ALGORITHM

        private static final java.lang.String KEY_ALGORITHM
        另请参阅:
        常量字段值
      • KEY_SIZE

        private static final int KEY_SIZE
        另请参阅:
        常量字段值
    • 构造器详细资料

      • RasUtil

        public RasUtil()
    • 方法详细资料

      • initKey

        public static java.security.KeyPair initKey()
                                             throws java.lang.Exception
        抛出:
        java.lang.Exception
      • encryptByPrivateKey

        public static byte[] encryptByPrivateKey​(byte[] data,
                                                 byte[] key)
        私钥加密
        参数:
        data - 待加密数据
        key - 密钥
        返回:
        byte[] 加密数据
      • encryptByPrivateKey

        public static byte[] encryptByPrivateKey​(byte[] data,
                                                 byte[] key,
                                                 int start,
                                                 int length)
      • getPrivateKey

        public static byte[] getPrivateKey​(java.security.KeyPair keyPair)
      • getPublicKey

        public static byte[] getPublicKey​(java.security.KeyPair keyPair)