Map<String,Object> encryParam = new HashMap<>(5);
        encryParam.put("connectorUrl",connectorUrl);
        encryParam.put("token",token);
        encryParam.put("plugin",pluginsList);
        encryParam.put("ipAddress",connectorConfig.getIpAddress().split("//")[1]);
        encryParam.put("port",connectorConfig.getConnectorPort());
        String encryParamJson = JSON.toJSONString(encryParam);

        String base64 = Base64Utils.encode(encryParamJson.getBytes());

        byte[] encryDataByte =
                RSAUtils.encryptByPublicKey(Base64Utils.decode(base64), publicKey);
        String encryData = Base64Utils.encode(encryDataByte);

        System.out.println("加密后的字符串:" + encryData);

        Map<String,Object> responseParam = new HashMap<>(5);
        responseParam.put("encryData",encryData);
        responseParam.put("data",encryParamJson);
        responseParam.put("timeStamp",new DateTime().toString("yyyy-MM-dd HH:mm:ss"));

相关文章:

  • 2022-12-23
  • 2021-08-07
  • 2021-05-30
  • 2021-08-07
  • 2021-08-02
  • 2021-09-25
猜你喜欢
  • 2021-09-10
  • 2021-07-25
  • 2021-11-03
  • 2021-10-18
  • 2021-04-21
相关资源
相似解决方案