类 RSAUtil


  • @IocBean
    public class RSAUtil
    extends Object
    Created by wizzer on 2017/4/24.
    • 构造器详细资料

      • RSAUtil

        public RSAUtil()
    • 方法详细资料

      • getPublicKey

        public static RSAPublicKey getPublicKey​(String modulus,
                                                String exponent)
        使用模和指数生成RSA公钥
        参数:
        modulus - 模
        exponent - 指数
        返回:
      • getPrivateKey

        public static RSAPrivateKey getPrivateKey​(String modulus,
                                                  String exponent)
        使用模和指数生成RSA私钥 /None/NoPadding
        参数:
        modulus - 模
        exponent - 指数
        返回:
      • ASCII_To_BCD

        public static byte[] ASCII_To_BCD​(byte[] ascii,
                                          int asc_len)
        ASCII码转BCD码
      • asc_to_bcd

        public static byte asc_to_bcd​(byte asc)
      • bcd2Str

        public static String bcd2Str​(byte[] bytes)
        BCD转字符串
      • splitString

        public static String[] splitString​(String string,
                                           int len)
        拆分字符串
      • splitArray

        public static byte[][] splitArray​(byte[] data,
                                          int len)
        拆分数组