docs 补充项目注释
This commit is contained in:
+11
@@ -90,9 +90,20 @@ public class EncryptedFieldProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加密字段处理回调。
|
||||
*/
|
||||
@FunctionalInterface
|
||||
private interface FieldHandler {
|
||||
|
||||
/**
|
||||
* 处理单个加密字段。
|
||||
*
|
||||
* @param target 字段所属对象
|
||||
* @param field 加密字段
|
||||
* @param value 字段原始字符串值
|
||||
* @throws IllegalAccessException 字段访问失败时抛出
|
||||
*/
|
||||
void handle(Object target, Field field, String value) throws IllegalAccessException;
|
||||
}
|
||||
|
||||
|
||||
+15
@@ -168,6 +168,15 @@ public class EncryptorManager {
|
||||
return fieldSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加密器缓存键。
|
||||
*
|
||||
* @param algorithm 加密算法
|
||||
* @param encode 编码方式
|
||||
* @param password 密码
|
||||
* @param publicKey 公钥
|
||||
* @param privateKey 私钥
|
||||
*/
|
||||
private record EncryptorCacheKey(
|
||||
AlgorithmType algorithm,
|
||||
EncodeType encode,
|
||||
@@ -176,6 +185,12 @@ public class EncryptorManager {
|
||||
String privateKey
|
||||
) {
|
||||
|
||||
/**
|
||||
* 从加密上下文构建缓存键。
|
||||
*
|
||||
* @param encryptContext 加密上下文
|
||||
* @return 加密器缓存键
|
||||
*/
|
||||
private static EncryptorCacheKey of(EncryptContext encryptContext) {
|
||||
return new EncryptorCacheKey(
|
||||
encryptContext.getAlgorithm(),
|
||||
|
||||
+3
@@ -44,5 +44,8 @@ public enum AlgorithmType {
|
||||
*/
|
||||
SM4(Sm4Encryptor.class);
|
||||
|
||||
/**
|
||||
* 算法对应的加密器类型。
|
||||
*/
|
||||
private final Class<? extends AbstractEncryptor> clazz;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user