当前位置:网站首页>RSA signature issues

RSA signature issues

2022-06-11 10:12:00 Yu 1990

RSA Problems encountered in parameter verification :

1、 And PHP The problem of signature algorithm during docking :

PHP The default is :SHA1withRSA Signature algorithm     and JAVA Generally, our default is :MD5withRSA  Therefore, the docking process needs to be unified

2、 Signature problem

json When JSON Package de sorting

      String jsonResult  =  JSON.toJSONString(transferDaoVo, SerializerFeature.MapSortField);
        JSONObject object =  JSON.parseObject(jsonResult);
        try{
            object.put("sign", RSAUtils.sign( jsonResult.getBytes() , privateKey ) );
            String result = JSON.toJSONString(object, SerializerFeature.MapSortField);
            return result;
        }catch (Exception e){
            logger.info(" Signature error ",e);
        }

For common parameters, use key=value&key=value Sort by

 

原网站

版权声明
本文为[Yu 1990]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206110928060436.html