【fix sonar】EncryptedString文件

This commit is contained in:
梁琦涛
2023-04-03 17:27:27 +08:00
parent 24d705b4f2
commit 42da5cff6f
@@ -2,15 +2,42 @@ package com.jero.common.util.encryption;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@Data
@Component
public class EncryptedString {
private EncryptedString(){
}
public static String ENCRYPTED_KEY;
//长度为16个字符
public static final String ENCRYPTED_KEY = "1234567890adbcde";
@Value("${jero.password.aes.encrypted_key}")
public String encryptedKeyStr;
@PostConstruct
public void setEncryptedKeyStr(){
synchronized (EncryptedString.class){
if(ENCRYPTED_KEY == null){
ENCRYPTED_KEY = this.encryptedKeyStr;
}
}
}
//长度为16个字符
public static final String ENCRYPTED_IV = "1234567890hjlkew";
public static String ENCRYPTED_IV;
@Value("${jero.password.aes.encrypted_iv}")
public String encryptedIvStr;
@PostConstruct
public void setEncryptedIvStr(){
synchronized (EncryptedString.class){
if(ENCRYPTED_IV == null){
ENCRYPTED_IV = this.encryptedIvStr;
}
}
}
}