hsm keystore reload 주기 설정 추가
This commit is contained in:
@@ -52,7 +52,8 @@ public class HsmManager implements Lifecycle {
|
|||||||
private static final String GROUP_NAME = "HSM";
|
private static final String GROUP_NAME = "HSM";
|
||||||
private static final String PROP_CONFIG = "PKCS11_CONFIG";
|
private static final String PROP_CONFIG = "PKCS11_CONFIG";
|
||||||
private static final String PROP_PIN = "PIN";
|
private static final String PROP_PIN = "PIN";
|
||||||
|
private static final String PROP_RELOAD_INTERVAL_MINUTES = "RELOAD_INTERVAL_MINUTES";
|
||||||
|
|
||||||
private Provider pkcs11Provider;
|
private Provider pkcs11Provider;
|
||||||
private volatile KeyStore keyStore;
|
private volatile KeyStore keyStore;
|
||||||
private boolean started;
|
private boolean started;
|
||||||
@@ -62,7 +63,7 @@ public class HsmManager implements Lifecycle {
|
|||||||
private volatile char[] pin;
|
private volatile char[] pin;
|
||||||
|
|
||||||
// 재로드 주기 (분 단위). 필요시 PropManager로 외부화 가능.
|
// 재로드 주기 (분 단위). 필요시 PropManager로 외부화 가능.
|
||||||
private static final long RELOAD_INTERVAL_MINUTES = 1;
|
private static long RELOAD_INTERVAL_MINUTES = 1;
|
||||||
private ScheduledExecutorService scheduler;
|
private ScheduledExecutorService scheduler;
|
||||||
private ScheduledFuture<?> reloadFuture;
|
private ScheduledFuture<?> reloadFuture;
|
||||||
|
|
||||||
@@ -92,6 +93,9 @@ public class HsmManager implements Lifecycle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void init() throws Exception {
|
private void init() throws Exception {
|
||||||
|
|
||||||
|
String reloadIntervalStr = PropManager.getInstance().getProperty(GROUP_NAME, PROP_RELOAD_INTERVAL_MINUTES, "10");
|
||||||
|
RELOAD_INTERVAL_MINUTES = Long.parseLong(reloadIntervalStr);
|
||||||
EncryptionManager encManager = EncryptionManager.getInstance();
|
EncryptionManager encManager = EncryptionManager.getInstance();
|
||||||
|
|
||||||
String configContent = encManager.decryptDBData(PropManager.getInstance().getProperty(GROUP_NAME, PROP_CONFIG));
|
String configContent = encManager.decryptDBData(PropManager.getInstance().getProperty(GROUP_NAME, PROP_CONFIG));
|
||||||
|
|||||||
Reference in New Issue
Block a user