Jasypt 암호화
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package app.module.admin.config.application.bean;
|
||||
|
||||
import org.jasypt.encryption.StringEncryptor;
|
||||
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
|
||||
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class JasyptConfig {
|
||||
@Value("${jasypt.encryptor.password}")
|
||||
private String jasyptPassword;
|
||||
|
||||
@Value("${jasypt.encryptor.algorithm}")
|
||||
private String jasyptAlgorithm;
|
||||
|
||||
@Bean("jasyptStringEncryptor")
|
||||
public StringEncryptor stringEncryptor() {
|
||||
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
|
||||
config.setPassword(jasyptPassword); // 암호화할 때 사용하는 키
|
||||
config.setPoolSize("1"); // 인스턴스 pool
|
||||
config.setAlgorithm(jasyptAlgorithm); // 암호화 알고리즘
|
||||
config.setStringOutputType("base64"); // 인코딩 방식
|
||||
config.setKeyObtentionIterations("1000"); // 반복할 해싱 회수
|
||||
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator"); // salt 생성 클래스
|
||||
config.setIvGeneratorClassName("org.jasypt.iv.RandomIvGenerator");
|
||||
|
||||
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
|
||||
encryptor.setConfig(config);
|
||||
return encryptor;
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public class AutoSchedulesController {
|
||||
}
|
||||
|
||||
// 매일 오후 5시 마다 실행되는 스케줄러
|
||||
@Scheduled(cron = "5 * * * * ?")
|
||||
@Scheduled(cron = "0 1 * * * ?")
|
||||
public void fetchSmsAutoSenTest() {
|
||||
portIn.sendAutoSmsTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user