|
|
@ -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
|
|
|
|
);
|
|
|
|
);
|
|
|
|