From 2ed1199d48f7207f4a012c04f61e13ac1a8d5154 Mon Sep 17 00:00:00 2001 From: chenjiahe <763432473@qq.com> Date: 星期四, 16 六月 2022 10:27:44 +0800 Subject: [PATCH] 新增请求安全工具 --- src/main/java/com/hx/mybatis/aes/handler/GenericStringHandler.java | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/hx/mybatis/aes/handler/GenericStringHandler.java b/src/main/java/com/hx/mybatis/aes/handler/GenericStringHandler.java index b31fbf1..2598bdf 100644 --- a/src/main/java/com/hx/mybatis/aes/handler/GenericStringHandler.java +++ b/src/main/java/com/hx/mybatis/aes/handler/GenericStringHandler.java @@ -1,7 +1,7 @@ package com.hx.mybatis.aes.handler; import com.hx.mybatis.aes.springbean.VariableAesKey; -import com.hx.util.mysql.aes.MysqlHexAes; +import com.hx.util.mysql.aes.MysqlHexAesTool; import org.apache.ibatis.type.BaseTypeHandler; import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.MappedJdbcTypes; @@ -32,9 +32,9 @@ @Override public String getNullableResult(ResultSet rs, String columnName) throws SQLException { String data = rs.getString(columnName); - if(data != null && data.length()%32==0 && MysqlHexAes.isHexStrValid(data)){ + if(data != null && data.length()%32==0 && MysqlHexAesTool.isHexStrValid(data)){ try{ - data = MysqlHexAes.decryptData(data, VariableAesKey.getAesKey(columnName),null); + data = MysqlHexAesTool.decryptData(data, VariableAesKey.getAesKey(columnName),null); }catch (Exception e){ //e.printStackTrace(); } @@ -45,9 +45,9 @@ @Override public String getNullableResult(ResultSet rs, int columnIndex) throws SQLException { String data = rs.getString(columnIndex); - if(data != null && data.length()%32==0 && MysqlHexAes.isHexStrValid(data)){ + if(data != null && data.length()%32==0 && MysqlHexAesTool.isHexStrValid(data)){ try{ - data = MysqlHexAes.decryptData(data, VariableAesKey.getAesKey(null),null); + data = MysqlHexAesTool.decryptData(data, VariableAesKey.getAesKey(null),null); }catch (Exception e){ //e.printStackTrace(); } @@ -58,9 +58,9 @@ @Override public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { String data = cs.getString(columnIndex); - if(data != null && data.length() < 129 && data.length()%32==0 && MysqlHexAes.isHexStrValid(data)){ + if(data != null && data.length() < 129 && data.length()%32==0 && MysqlHexAesTool.isHexStrValid(data)){ try{ - data = MysqlHexAes.decryptData(data, VariableAesKey.getAesKey(null),null); + data = MysqlHexAesTool.decryptData(data, VariableAesKey.getAesKey(null),null); }catch (Exception e){ //e.printStackTrace(); } -- Gitblit v1.8.0