|
|
|
@ -4,7 +4,6 @@ import egovframework.com.cmm.EgovMessageSource;
|
|
|
|
|
import javax.transaction.Transactional;
|
|
|
|
|
import kr.xit.biz.cmm.service.CmmEnsCacheService;
|
|
|
|
|
import kr.xit.biz.common.ApiConstants.SignguCode;
|
|
|
|
|
import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiReqEncData;
|
|
|
|
|
import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiResDataBody;
|
|
|
|
|
import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiResponse;
|
|
|
|
|
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiInfo;
|
|
|
|
@ -22,8 +21,6 @@ import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResDataBody;
|
|
|
|
|
import kr.xit.biz.ens.model.nice.NiceCiDTO.TokenRevokeResponse;
|
|
|
|
|
import kr.xit.biz.nice.mapper.IBizNiceCiMapper;
|
|
|
|
|
import kr.xit.core.exception.BizRuntimeException;
|
|
|
|
|
import kr.xit.core.support.utils.DateUtils;
|
|
|
|
|
import kr.xit.core.support.utils.IpMacUtils;
|
|
|
|
|
import kr.xit.core.support.utils.JsonUtils;
|
|
|
|
|
import kr.xit.ens.cmm.CmmEnsUtils;
|
|
|
|
|
import kr.xit.ens.nice.cmm.CmmNiceCiUtils;
|
|
|
|
@ -288,17 +285,7 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
|
|
|
|
|
// 아이핀 CI 요청
|
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
|
public IpinCiResponse requestCi(final NiceCiRequest reqDTO) {
|
|
|
|
|
NiceCiInfo niceDTO = CmmNiceCiUtils.getSymkeyNiceCiInfo(reqDTO);
|
|
|
|
|
IpinCiReqEncData encDataDTO = IpinCiReqEncData.builder()
|
|
|
|
|
.siteCode(niceDTO.getSiteCode())
|
|
|
|
|
//.infoReqType() //default: 1-CI제공
|
|
|
|
|
.juminId(reqDTO.getJuminId())
|
|
|
|
|
.reqNo(CmmEnsUtils.generateLengthUuid(30))
|
|
|
|
|
.reqDtim(DateUtils.getTodayAndNowTime("yyyyMMddHHmmss"))
|
|
|
|
|
.clientIp(IpMacUtils.getIpAddress().get(0))
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
IpinCiResponse ipinCiResponse = niceCiService.requestCi(CmmEnsUtils.generateLengthUuid(24), encDataDTO, niceDTO);
|
|
|
|
|
IpinCiResponse ipinCiResponse = niceCiService.requestCi(reqDTO);
|
|
|
|
|
|
|
|
|
|
ResponseDataHeader resHeader = ipinCiResponse.getDataHeader();
|
|
|
|
|
IpinCiResDataBody resBody = ipinCiResponse.getDataBody();
|
|
|
|
@ -308,6 +295,7 @@ public class BizNiceCiService extends EgovAbstractServiceImpl implements IBizNic
|
|
|
|
|
//FIXME::응답무결성 체크
|
|
|
|
|
// 응답으로온 intigrety_value와 응답 enc_data를 Hmac한 값을 비교
|
|
|
|
|
// 무결성체크가 완료되면 데이터를 보낸 대칭키로 복호화하여 데이터를 확인
|
|
|
|
|
NiceCiInfo niceDTO = CmmNiceCiUtils.getSymkeyNiceCiInfo(reqDTO);
|
|
|
|
|
String checkHmac = CmmEnsUtils.encodeHmacSha256(niceDTO.getCurSymkeyHmacKey(), resEncData);
|
|
|
|
|
if(resBody.getIntegrityValue().equals(checkHmac)){
|
|
|
|
|
String decData = CmmEnsUtils.decodeAesData(resEncData, niceDTO.getCurSymkeyKey(), niceDTO.getCurSymkeyIv());
|
|
|
|
|