seatonwan9
2025-08-28 e99dcf16787af69c69d16afcd92b6bf8922eede1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.webmanage.config;
 
import org.springframework.util.StringUtils;
 
/**
 * 检测配置值是否为加密格式的工具
 */
public class EncryptedPropertyDetector {
 
    private static final String PREFIX = "AES:";
 
    public static boolean isEncrypted(String value) {
        return StringUtils.hasText(value) && value.startsWith(PREFIX);
    }
 
    public static String stripPrefix(String value) {
        if (!isEncrypted(value)) {
            return value;
        }
        return value.substring(PREFIX.length());
    }
}