feat: KT, Nice API 반영

dev
gitea-관리자 1 year ago
parent f207566e96
commit 0b194d28e9

@ -162,7 +162,7 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
public PublickeyResponse requestPublickey(final NiceCiRequest reqDTO) { public PublickeyResponse requestPublickey(final NiceCiRequest reqDTO) {
final NiceCiInfo niceDTO = CmmNiceCiUtils.getNiceCiInfo(reqDTO); final NiceCiInfo niceDTO = CmmNiceCiUtils.getNiceCiInfo(reqDTO);
if(ObjectUtils.isEmpty(niceDTO.getAccessToken())) throw BizRuntimeException.create(messageSource.getMessage("fail.api.nice.token.info")); if(ObjectUtils.isEmpty(niceDTO.getAccessToken())) throw BizRuntimeException.create(messageSource.getMessage("fail.api.nice.token.info"));
reqDTO.setTranId(CmmEnsUtils.generateLengthUuid(24));
final PublickeyResponse pubResDTO = niceCiService.requestPublickey(reqDTO); final PublickeyResponse pubResDTO = niceCiService.requestPublickey(reqDTO);
//FIXME::공개키 정보 갱신 - Error code enum 전환 //FIXME::공개키 정보 갱신 - Error code enum 전환
@ -228,10 +228,8 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
final String ffnlgCode = reqDTO.getFfnlgCode(); final String ffnlgCode = reqDTO.getFfnlgCode();
//FIXME::NICE 연계이후 메소드 교체 //FIXME::NICE 연계이후 메소드 교체
final NiceCiInfo niceDTO = CmmNiceCiUtils.getPublickeyNiceCiInfo(reqDTO); final SymkeyRegInfo symkeyRegInfo = CmmNiceCiUtils.getSymkeyRegInfo();
final SymkeyRegInfo symkeyRegInfo = CmmNiceCiUtils.getSymkeyRegInfo(niceDTO.getSiteCode()); SymmetrickeyResponse symResDTO = niceCiService.requestRegSymmetrickey(reqDTO, symkeyRegInfo);
SymmetrickeyResponse symResDTO = niceCiService.requestRegSymmetrickey(CmmEnsUtils.generateLengthUuid(24), symkeyRegInfo, niceDTO);
final ResponseDataHeader dataHeader = symResDTO.getDataHeader(); final ResponseDataHeader dataHeader = symResDTO.getDataHeader();
final SymmetrickeyResDataBody dataBody = symResDTO.getDataBody(); final SymmetrickeyResDataBody dataBody = symResDTO.getDataBody();
@ -240,7 +238,10 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
//FIXME:: "0007" 인 경우 확인 필요 - result_cd 0000, 0007일 경우 나감 (0007: key 중복 오류 (현재 및 직전에 사용한 Key 사용 불가) //FIXME:: "0007" 인 경우 확인 필요 - result_cd 0000, 0007일 경우 나감 (0007: key 중복 오류 (현재 및 직전에 사용한 Key 사용 불가)
&& dataBody.getResultCd().equals("0000")){ && dataBody.getResultCd().equals("0000")){
SymkeyStatInfo symkeyStatInfo = JsonUtils.toObject(dataBody.getSymkeyStatInfo(), SymkeyStatInfo.class); SymkeyStatInfo symkeyStatInfo = JsonUtils.toObject(dataBody.getSymkeyStatInfo(), SymkeyStatInfo.class);
NiceCiInfo niceDTO = NiceCiInfo.builder()
.signguCode(reqDTO.getSignguCode())
.ffnlgCode(reqDTO.getFfnlgCode())
.build();
niceDTO.setBefSymkeyVersion(symkeyStatInfo.getBefSymkeyVersion()); niceDTO.setBefSymkeyVersion(symkeyStatInfo.getBefSymkeyVersion());
niceDTO.setBefSymkeyValidDtim(symkeyStatInfo.getBefValidDtim()); niceDTO.setBefSymkeyValidDtim(symkeyStatInfo.getBefValidDtim());
niceDTO.setBefSymkeyKey(niceDTO.getCurSymkeyKey()); niceDTO.setBefSymkeyKey(niceDTO.getCurSymkeyKey());

@ -2,10 +2,10 @@ package kr.xit.core.spring.util;
import kr.xit.biz.cmm.service.CmmEnsCacheService; import kr.xit.biz.cmm.service.CmmEnsCacheService;
import kr.xit.biz.cmm.service.ICmmEnsCacheService; import kr.xit.biz.cmm.service.ICmmEnsCacheService;
import kr.xit.biz.nice.service.IBizNiceCiService;
import kr.xit.core.spring.config.support.ApplicationContextProvider; import kr.xit.core.spring.config.support.ApplicationContextProvider;
import kr.xit.ens.kt.service.IKtMmsService; import kr.xit.ens.kt.service.IKtMmsService;
import kr.xit.ens.nice.service.INiceCiService; import kr.xit.ens.nice.service.INiceCiService;
import kr.xit.ens.nice.service.NiceCiDummyTestService;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
@ -54,11 +54,11 @@ public class ApiSpringUtils {
return (INiceCiService)getBean(INiceCiService.class); return (INiceCiService)getBean(INiceCiService.class);
} }
public static IKtMmsService getKtMmsService(){ public static IBizNiceCiService getBizNiceCiService(){
return (IKtMmsService)getBean(IKtMmsService.class); return (IBizNiceCiService)getBean(IBizNiceCiService.class);
} }
public static NiceCiDummyTestService getDummyNiceCiService(){ public static IKtMmsService getKtMmsService(){
return (NiceCiDummyTestService)getBean(NiceCiDummyTestService.class); return (IKtMmsService)getBean(IKtMmsService.class);
} }
} }

@ -4,8 +4,11 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.InvalidAlgorithmParameterException; import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException; import java.security.InvalidKeyException;
import java.security.KeyFactory;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64; import java.util.Base64;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@ -27,6 +30,7 @@ import javax.validation.Validator;
import kr.xit.core.exception.BizRuntimeException; import kr.xit.core.exception.BizRuntimeException;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.springframework.util.Base64Utils;
/** /**
* <pre> * <pre>
@ -75,6 +79,44 @@ public class CmmEnsUtils {
return String.valueOf(otp); return String.valueOf(otp);
} }
/**
*
*
* @param publicKeyString
* @param symkeyRegInfo
* @return String
* @throws NoSuchAlgorithmException
* @throws InvalidKeySpecException
* @throws NoSuchPaddingException
* @throws InvalidKeyException
* @throws IllegalBlockSizeException
* @throws BadPaddingException
*/
public static String encSymkeyRegInfo(String publicKeyString, String symkeyRegInfo) {
try {
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
byte[] cipherEnc = Base64.getDecoder().decode(publicKeyString);
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(cipherEnc);
java.security.PublicKey publicKey = keyFactory.generatePublic(publicKeySpec);
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
byte[] bytePlain = cipher.doFinal(symkeyRegInfo.getBytes());
return Base64Utils.encodeToString(bytePlain);
} catch (NoSuchAlgorithmException | InvalidKeySpecException e){
throw BizRuntimeException.create(e.getMessage());
} catch (NoSuchPaddingException e) {
throw BizRuntimeException.create(e.getMessage());
} catch (IllegalBlockSizeException e) {
throw BizRuntimeException.create(e.getMessage());
} catch (BadPaddingException e) {
throw BizRuntimeException.create(e.getMessage());
} catch (InvalidKeyException e) {
throw BizRuntimeException.create(e.getMessage());
}
}
/** /**
* sha256 * sha256
* *

@ -11,6 +11,7 @@ import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.ResponseDataHeader; import kr.xit.biz.ens.model.nice.NiceCiDTO.ResponseDataHeader;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymkeyRegInfo; import kr.xit.biz.ens.model.nice.NiceCiDTO.SymkeyRegInfo;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse; import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse;
import kr.xit.biz.nice.service.IBizNiceCiService;
import kr.xit.core.exception.BizRuntimeException; import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.spring.util.ApiSpringUtils; import kr.xit.core.spring.util.ApiSpringUtils;
import kr.xit.core.spring.util.CoreSpringUtils; import kr.xit.core.spring.util.CoreSpringUtils;
@ -45,6 +46,7 @@ public class CmmNiceCiUtils {
private static final EgovMessageSource messageSource = CoreSpringUtils.getMessageSource(); private static final EgovMessageSource messageSource = CoreSpringUtils.getMessageSource();
private static final ICmmEnsCacheService cacheService = ApiSpringUtils.getCmmEnsCacheService(); private static final ICmmEnsCacheService cacheService = ApiSpringUtils.getCmmEnsCacheService();
private static final INiceCiService niceCiService = ApiSpringUtils.getNiceCiService(); private static final INiceCiService niceCiService = ApiSpringUtils.getNiceCiService();
private static final IBizNiceCiService bizNiceService = ApiSpringUtils.getBizNiceCiService();
/** /**
* Nice * Nice
@ -76,15 +78,14 @@ public class CmmNiceCiUtils {
if(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss").compareTo(niceDTO.getValidDtim()) < 0) return niceDTO; if(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss").compareTo(niceDTO.getValidDtim()) < 0) return niceDTO;
// 1. 토큰 폐기 // 1. 토큰 폐기
TokenRevokeResponse revokeResDTO = niceCiService.revokeToken(reqDTO); TokenRevokeResponse revokeResDTO = bizNiceService.revokeToken(reqDTO);
if(!(revokeResDTO.getDataHeader().getGwRsltCd().equals("1200") && revokeResDTO.getDataBody().isResult())){ if(!(revokeResDTO.getDataHeader().getGwRsltCd().equals("1200") && revokeResDTO.getDataBody().isResult())){
throw BizRuntimeException.create(JsonUtils.toJson(revokeResDTO.getDataHeader())); throw BizRuntimeException.create(JsonUtils.toJson(revokeResDTO.getDataHeader()));
} }
// 2. 공개키 발급 요청 // 2. 공개키 발급 처리
reqDTO.setTranId(CmmEnsUtils.generateLengthUuid(24)); bizNiceService.requestPublickey(reqDTO);
niceCiService.requestPublickey(reqDTO);
return cacheService.getNiceCiInfoCache(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()); return cacheService.getNiceCiInfoCache(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
} }
@ -103,8 +104,8 @@ public class CmmNiceCiUtils {
final NiceCiInfo niceDTO = getPublickeyNiceCiInfo(reqDTO); final NiceCiInfo niceDTO = getPublickeyNiceCiInfo(reqDTO);
if(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss").compareTo(niceDTO.getCurSymkeyValidDtim()) < 0) return niceDTO; if(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss").compareTo(niceDTO.getCurSymkeyValidDtim()) < 0) return niceDTO;
// 1. 토큰 폐기 // 대칭키 발행 등록
niceCiService.requestRegSymmetrickey(CmmEnsUtils.generateLengthUuid(24), null, niceDTO); bizNiceService.requestRegSymmetrickey(reqDTO);
return cacheService.getNiceCiInfoCache(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()); return cacheService.getNiceCiInfoCache(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
} }
@ -112,13 +113,13 @@ public class CmmNiceCiUtils {
/** /**
* <pre> * <pre>
* (symmetrickey) symkey_reg_info JSON * (symmetrickey) symkey_reg_info JSON
* @param siteCode * -> siteCode DB set
* @return * @return SymkeyRegInfo
* </pre> * </pre>
*/ */
public static SymkeyRegInfo getSymkeyRegInfo(String siteCode) { public static SymkeyRegInfo getSymkeyRegInfo() {
return SymkeyRegInfo.builder() return SymkeyRegInfo.builder()
.siteCode(siteCode) //.siteCode()
.requestNo(CmmEnsUtils.generateLengthUuid(30)) .requestNo(CmmEnsUtils.generateLengthUuid(30))
.key(CmmEnsUtils.generateLengthUuid(32)) .key(CmmEnsUtils.generateLengthUuid(32))
.iv(CmmEnsUtils.generateLengthUuid(16)) .iv(CmmEnsUtils.generateLengthUuid(16))
@ -154,8 +155,8 @@ public class CmmNiceCiUtils {
* </pre> * </pre>
*/ */
public static <T> T checkTranIdAndReturn(final String tranId, final ResponseDataHeader resHeader, T t){ public static <T> T checkTranIdAndReturn(final String tranId, final ResponseDataHeader resHeader, T t){
if(!resHeader.getGwRsltCd().equals("1200")) return t;
if(!tranId.equals(resHeader.getTranId())) throw BizRuntimeException.create(messageSource.getMessage("fail.api.nice.invalid.tranId")); if(!tranId.equals(resHeader.getTranId())) throw BizRuntimeException.create(messageSource.getMessage("fail.api.nice.invalid.tranId"));
if(!resHeader.getGwRsltCd().equals("1200")) return t;
return t; return t;
} }
} }

@ -4,10 +4,10 @@ import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiReqEncData;
import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiResponse; import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiInfo; import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiInfo;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiRequest; import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceTokenResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyResponse; import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymkeyRegInfo; import kr.xit.biz.ens.model.nice.NiceCiDTO.SymkeyRegInfo;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyResponse; import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceTokenResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse; import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse;
/** /**
@ -46,7 +46,8 @@ public interface INiceCiService {
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
// 대칭키 : symmetrickey // 대칭키 : symmetrickey
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
SymmetrickeyResponse requestRegSymmetrickey(final String tranId, final SymkeyRegInfo symkeyRegInfo, final NiceCiInfo niceDTO); SymmetrickeyResponse requestRegSymmetrickey(final NiceCiRequest reqDTO, final
SymkeyRegInfo symkeyRegInfo);
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
// 대칭키 : symmetrickey // 대칭키 : symmetrickey
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------

@ -138,7 +138,7 @@ public class NiceCiDummyTestService extends EgovAbstractServiceImpl {
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
public SymmetrickeyResponse requestRegSymmetrickey(final NiceCiRequest reqDTO) { public SymmetrickeyResponse requestRegSymmetrickey(final NiceCiRequest reqDTO) {
final NiceCiInfo niceDTO = CmmNiceCiUtils.getPublickeyNiceCiInfo(reqDTO); final NiceCiInfo niceDTO = CmmNiceCiUtils.getPublickeyNiceCiInfo(reqDTO);
final SymkeyRegInfo symkeyRegInfo = CmmNiceCiUtils.getSymkeyRegInfo(niceDTO.getSiteCode()); final SymkeyRegInfo symkeyRegInfo = CmmNiceCiUtils.getSymkeyRegInfo();
//FIXME::NICE 연계이후 comment 제거 //FIXME::NICE 연계이후 comment 제거
//String encSymkeyRegInfo = encodeString(niceDTO.getPublicKey(), JsonUtils.toJson(symkeyRegInfo)); //String encSymkeyRegInfo = encodeString(niceDTO.getPublicKey(), JsonUtils.toJson(symkeyRegInfo));

@ -4,12 +4,14 @@ import egovframework.com.cmm.EgovMessageSource;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiInfo;
import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiReqDataBody; import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiReqDataBody;
import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiReqEncData; import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiReqEncData;
import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiRequest; import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiResponse; import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiInfo;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiRequest; import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceTokenRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceTokenResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyReqDataBody; import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyReqDataBody;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyRequest; import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyResponse; import kr.xit.biz.ens.model.nice.NiceCiDTO.PublickeyResponse;
@ -18,8 +20,6 @@ import kr.xit.biz.ens.model.nice.NiceCiDTO.SymkeyRegInfo;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyReqDataBody; import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyReqDataBody;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyRequest; import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyResponse; import kr.xit.biz.ens.model.nice.NiceCiDTO.SymmetrickeyResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceTokenRequest;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceTokenResponse;
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse; import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse;
import kr.xit.core.exception.BizRuntimeException; import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.spring.annotation.TraceLogging; import kr.xit.core.spring.annotation.TraceLogging;
@ -158,10 +158,11 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
final String todayDt = DateUtils.getTodayAndNowTime("yyyyMMddHHmmss"); final String todayDt = DateUtils.getTodayAndNowTime("yyyyMMddHHmmss");
final String tranId = CmmEnsUtils.generateLengthUuid(24);
final PublickeyRequest pubReqDTO = PublickeyRequest.builder() final PublickeyRequest pubReqDTO = PublickeyRequest.builder()
.dataHeader(RequestDataHeader.builder() .dataHeader(RequestDataHeader.builder()
.cntyId(CNTY_CD) .cntyId(CNTY_CD)
.tranId(reqDTO.getTranId()) .tranId(tranId)
.build()) .build())
.dataBody(PublickeyReqDataBody.builder() .dataBody(PublickeyReqDataBody.builder()
.reqDtim(todayDt) .reqDtim(todayDt)
@ -184,7 +185,7 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
headerMap headerMap
); );
return CmmNiceCiUtils.checkTranIdAndReturn(reqDTO.getTranId(), pubResDTO.getDataHeader(), pubResDTO); return CmmNiceCiUtils.checkTranIdAndReturn(tranId, pubResDTO.getDataHeader(), pubResDTO);
} }
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
@ -205,12 +206,15 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
* </pre> * </pre>
*/ */
@Override @Override
public SymmetrickeyResponse requestRegSymmetrickey(final String tranId, final SymkeyRegInfo symkeyRegInfo, final NiceCiInfo niceDTO) { public SymmetrickeyResponse requestRegSymmetrickey(final NiceCiRequest reqDTO, final SymkeyRegInfo symkeyRegInfo) {
final NiceCiInfo niceDTO = CmmNiceCiUtils.getPublickeyNiceCiInfo(reqDTO);
// siteCode set
symkeyRegInfo.setSiteCode(niceDTO.getSiteCode());
//FIXME::NICE 연계이후 comment 제거 //FIXME::NICE 연계이후 comment 제거
final String encSymkeyRegInfo = CmmEnsUtils.encodeHmacSha256(niceDTO.getPublicKey(), JsonUtils.toJson(symkeyRegInfo)); final String encSymkeyRegInfo = CmmEnsUtils.encSymkeyRegInfo(niceDTO.getPublicKey(), JsonUtils.toJson(symkeyRegInfo));
final String tranId = CmmEnsUtils.generateLengthUuid(24);
final SymmetrickeyRequest reqDTO = SymmetrickeyRequest.builder() final SymmetrickeyRequest symReqDTO = SymmetrickeyRequest.builder()
.dataHeader(RequestDataHeader.builder() .dataHeader(RequestDataHeader.builder()
.cntyId(CNTY_CD) .cntyId(CNTY_CD)
.tranId(tranId) .tranId(tranId)
@ -220,7 +224,7 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
.symkeyRegInfo(encSymkeyRegInfo) .symkeyRegInfo(encSymkeyRegInfo)
.build()) .build())
.build(); .build();
CmmEnsUtils.validate(reqDTO); CmmEnsUtils.validate(symReqDTO);
final Map<String,String> headerMap = CmmNiceCiUtils.getAuthHeaderMap( final Map<String,String> headerMap = CmmNiceCiUtils.getAuthHeaderMap(
MediaType.APPLICATION_JSON_VALUE, AUTH_TYPE_BEARER, MediaType.APPLICATION_JSON_VALUE, AUTH_TYPE_BEARER,
@ -232,7 +236,7 @@ public class NiceCiService extends EgovAbstractServiceImpl implements INiceCiSer
final SymmetrickeyResponse symResDTO = webClient.exchange( final SymmetrickeyResponse symResDTO = webClient.exchange(
HOST + API_SYMMETRICKEY, HOST + API_SYMMETRICKEY,
HttpMethod.POST, HttpMethod.POST,
reqDTO, symReqDTO,
SymmetrickeyResponse.class, SymmetrickeyResponse.class,
headerMap headerMap
); );

@ -69,7 +69,6 @@ public class NiceCiController {
@Operation(deprecated = true, summary = "공개키 요청 -> 업무(Biz)단 API 사용", description = "NICE 정보 DB update가 필요하여 업무단의 API를 사용하여야 함") @Operation(deprecated = true, summary = "공개키 요청 -> 업무(Biz)단 API 사용", description = "NICE 정보 DB update가 필요하여 업무단의 API를 사용하여야 함")
@PostMapping(value = "/requestPublickey", produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/requestPublickey", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> requestPublickey(@RequestBody final NiceCiRequest reqDTO) { public ApiResponseDTO<?> requestPublickey(@RequestBody final NiceCiRequest reqDTO) {
reqDTO.setTranId(CmmEnsUtils.generateLengthUuid(24));
return ApiResponseDTO.success(service.requestPublickey(reqDTO)); return ApiResponseDTO.success(service.requestPublickey(reqDTO));
} }
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
@ -82,13 +81,7 @@ public class NiceCiController {
@Operation(deprecated = true, summary = "대칭키(symmetrickey) 등록 요청 -> 업무(Biz)단 API 사용", description = "NICE 정보 DB update가 필요하여 업무단의 API를 사용하여야 함") @Operation(deprecated = true, summary = "대칭키(symmetrickey) 등록 요청 -> 업무(Biz)단 API 사용", description = "NICE 정보 DB update가 필요하여 업무단의 API를 사용하여야 함")
@PostMapping(value = "/requestRegSymmetrickey", produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/requestRegSymmetrickey", produces = MediaType.APPLICATION_JSON_VALUE)
public ApiResponseDTO<?> requestRegSymmetrickey(@RequestBody final NiceCiRequest reqDTO) { public ApiResponseDTO<?> requestRegSymmetrickey(@RequestBody final NiceCiRequest reqDTO) {
return ApiResponseDTO.success( return ApiResponseDTO.success(service.requestRegSymmetrickey(reqDTO, CmmNiceCiUtils.getSymkeyRegInfo()));
service.requestRegSymmetrickey(
CmmEnsUtils.generateLengthUuid(24),
null,
CmmNiceCiUtils.getPublickeyNiceCiInfo(reqDTO)
)
);
} }
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------

@ -63,9 +63,9 @@ public class NiceCiDTO {
* : 24 * : 24
* </pre> * </pre>
*/ */
@Schema(requiredMode = RequiredMode.AUTO, title = "TRAN_ID", example = "20230906120000") // @Schema(requiredMode = RequiredMode.AUTO, title = "TRAN_ID", example = "20230906120000")
@Size(max = 24, message = "TRAN_ID는 24자를 넘을 수 없습니다.") // @Size(max = 24, message = "TRAN_ID는 24자를 넘을 수 없습니다.")
private String tranId;; // private String tranId;;
/** /**
* Id * Id

Loading…
Cancel
Save