어댑터 암복호화 필터 리팩토링
- 커스텀 패키지 지정 - 변수 이동
This commit is contained in:
@@ -24,13 +24,17 @@ import com.eactive.eai.common.util.Logger;
|
||||
* SafeNet ProtectServer HSM 연동 관리자 (JDK 8 / SunPKCS11)
|
||||
*
|
||||
* PropManager 그룹 "HSM" 에서 읽는 키:
|
||||
* PKCS11_CONFIG - pkcs11.cfg 파일 내용 (name/library/slot 설정을 DB에 직접 저장)
|
||||
* PKCS11_CONFIG - pkcs11.cfg 파일 내용
|
||||
* PIN - HSM 슬롯 PIN
|
||||
*
|
||||
* PKCS11_CONFIG 값 예시 (개행은 \n 으로 입력):
|
||||
* name = ProtectServer
|
||||
* library = /opt/safenet/protecttoolkit5/ptk/lib/libcryptoki.so
|
||||
* slot = 0
|
||||
*
|
||||
* name = SoftHSM
|
||||
* library = C:/SoftHSM2/lib/softhsm2-x64.dll
|
||||
* slotListIndex = 0
|
||||
*/
|
||||
@Component
|
||||
public class HsmManager implements Lifecycle {
|
||||
|
||||
@@ -3,7 +3,11 @@ package com.eactive.eai.common.security.keyderiv;
|
||||
import java.util.Map;
|
||||
|
||||
public interface KeyDerivationStrategy {
|
||||
|
||||
public static final String PARAM_HSM_KEY_ALIAS = "hsmKeyAlias";
|
||||
public static final String PARAM_CONTEXT_KEY = "contextKey";
|
||||
|
||||
|
||||
/**
|
||||
* 키를 도출한다.
|
||||
*
|
||||
|
||||
-2
@@ -14,8 +14,6 @@ import com.eactive.eai.common.util.ApplicationContextProvider;
|
||||
*/
|
||||
public abstract class BaseHsmKeyDerivationStrategy implements KeyDerivationStrategy {
|
||||
|
||||
protected static final String PARAM_HSM_KEY_ALIAS = "hsmKeyAlias";
|
||||
|
||||
protected byte[] getHsmKey(Map<String, String> params) throws HsmException {
|
||||
String hsmKeyAlias = required(params, PARAM_HSM_KEY_ALIAS);
|
||||
return getHsmKey(hsmKeyAlias);
|
||||
|
||||
-3
@@ -23,9 +23,6 @@ import com.eactive.eai.common.util.ApplicationContextProvider;
|
||||
*/
|
||||
public class HsmContextSha256KeyDerivationStrategy implements KeyDerivationStrategy {
|
||||
|
||||
private static final String PARAM_HSM_KEY_ALIAS = "hsmKeyAlias";
|
||||
private static final String PARAM_CONTEXT_KEY = "contextKey";
|
||||
|
||||
@Override
|
||||
public DerivedKey deriveKey(Map<String, String> params, Map<String, String> runtimeContext) throws Exception {
|
||||
String hsmKeyAlias = required(params, PARAM_HSM_KEY_ALIAS);
|
||||
|
||||
-2
@@ -26,8 +26,6 @@ public class HsmContextXorKeyDerivationStrategy implements KeyDerivationStrategy
|
||||
/** DB key_deriv_strategy 컬럼에 사용하는 FQCN 참조용 상수. */
|
||||
public static final String STRATEGY_CLASS = HsmContextXorKeyDerivationStrategy.class.getName();
|
||||
|
||||
private static final String PARAM_HSM_KEY_ALIAS = "hsmKeyAlias";
|
||||
private static final String PARAM_CONTEXT_KEY = "contextKey";
|
||||
private static final String PARAM_OFFSET = "offset";
|
||||
private static final String PARAM_LENGTH = "length";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user