|
|
|
@ -7,6 +7,7 @@ import com.fr.plugin.data.encrypt.dao.EncryptDataDao;
|
|
|
|
|
import com.fr.plugin.data.encrypt.entity.EncryptDataEntity; |
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
import com.fr.stable.Primitive; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.db.action.DBAction; |
|
|
|
|
import com.fr.stable.db.dao.DAOContext; |
|
|
|
|
import com.fr.stable.fun.Authorize; |
|
|
|
@ -26,7 +27,7 @@ public class FunConstants {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static final boolean author() { |
|
|
|
|
return PluginLicenseManager.getInstance().getPluginLicenseByID(PLUGIN_ID).isAvailable(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static final String CheckArgs(Object[] args, int num) { |
|
|
|
@ -60,6 +61,9 @@ public class FunConstants {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static final String HashData(String message,String type,boolean isSave){ |
|
|
|
|
if(StringUtils.isEmpty(message)){ |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
BigInteger shaID; |
|
|
|
|
byte[] inputData = message.getBytes(); |
|
|
|
|
try{ |
|
|
|
@ -93,9 +97,14 @@ public class FunConstants {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
final static String EncryptData(String secretKey, String message,String algorithm, boolean isEncrypt){ |
|
|
|
|
String result; |
|
|
|
|
PooledPBEStringEncryptor pooledPBEStringEncryptor = new PooledPBEStringEncryptor(); |
|
|
|
|
pooledPBEStringEncryptor.setConfig(GetSimpleStringPBEConfig(secretKey,algorithm)); |
|
|
|
|
String result = isEncrypt ? pooledPBEStringEncryptor.encrypt(message) : pooledPBEStringEncryptor.decrypt(message); |
|
|
|
|
try { |
|
|
|
|
result = isEncrypt ? pooledPBEStringEncryptor.encrypt(message) : pooledPBEStringEncryptor.decrypt(message); |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
result = Primitive.ERROR_VALUE + ":解密数据错误"; |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|