【fix sonar】EncryptedString文件
This commit is contained in:
+29
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user