불필요한 jsp 삭제
This commit is contained in:
@@ -1,218 +0,0 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<jsp:include page="/WEB-INF/view/include/inc_head.jsp"/>
|
||||
<jsp:include page="/WEB-INF/view/include/inc_head_script.jsp"/>
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/res/front/home/asset/css/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/res/front/home/asset/css/swiper.css" />
|
||||
|
||||
<script src="/res/front/js/biz/api/user-service.js?v=${timestamp}"></script>
|
||||
<script>
|
||||
|
||||
var callbackPhoneUpdate = function() {
|
||||
|
||||
lanedu.front.api.user.phoneUpdate({}, function (success, message, data) {
|
||||
if (!success) {
|
||||
alert(message);
|
||||
return false;
|
||||
}
|
||||
|
||||
alert('휴대폰 번호를 변경했습니다.');
|
||||
opener.location.reload();
|
||||
self.close();
|
||||
});
|
||||
};
|
||||
|
||||
var callbackPhoneAdd = function() {
|
||||
|
||||
lanedu.front.api.user.phoneAdd({}, function (success, message, data) {
|
||||
if (!success) {
|
||||
alert(message);
|
||||
return false;
|
||||
}
|
||||
|
||||
alert('휴대폰 번호를 추가했습니다.');
|
||||
opener.location.reload();
|
||||
self.close();
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var callbackCert = function() {
|
||||
|
||||
location.href = '/home/user/join';
|
||||
};
|
||||
</script>
|
||||
|
||||
<script language=javascript>
|
||||
|
||||
//window.name = "kmcis_web_sample";
|
||||
|
||||
var KMCIS_window;
|
||||
|
||||
|
||||
function openKMCISWindow(){
|
||||
|
||||
var UserAgent = navigator.userAgent;
|
||||
document.reqKMCISForm.target = '';
|
||||
document.reqKMCISForm.action = 'https://www.kmcert.com/kmcis/web/kmcisReq.jsp';
|
||||
document.reqKMCISForm.submit();
|
||||
}
|
||||
|
||||
function __openKMCISWindow(){
|
||||
|
||||
var UserAgent = navigator.userAgent;
|
||||
/* 모바일 접근 체크*/
|
||||
// 모바일일 경우 (변동사항 있을경우 추가 필요)
|
||||
if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) {
|
||||
document.reqKMCISForm.target = '';
|
||||
}
|
||||
|
||||
// 모바일이 아닐 경우
|
||||
else {
|
||||
KMCIS_window = window.open('', 'KMCISWindow', 'width=425, height=550, resizable=0, scrollbars=no, status=0, titlebar=0, toolbar=0, left=435, top=250' );
|
||||
|
||||
if(KMCIS_window == null){
|
||||
alert(" ※ 윈도우 XP SP2 또는 인터넷 익스플로러 7 사용자일 경우에는 \n 화면 상단에 있는 팝업 차단 알림줄을 클릭하여 팝업을 허용해 주시기 바랍니다. \n\n※ MSN,야후,구글 팝업 차단 툴바가 설치된 경우 팝업허용을 해주시기 바랍니다.");
|
||||
}
|
||||
|
||||
document.reqKMCISForm.target = 'KMCISWindow';
|
||||
}
|
||||
|
||||
document.reqKMCISForm.action = 'https://www.kmcert.com/kmcis/web/kmcisReq.jsp';
|
||||
//document.reqKMCISForm.action = '/extra/cert/result';
|
||||
document.reqKMCISForm.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<c:choose>
|
||||
<c:when test="${param.actionType eq 'PHONE_UPDATE'}">
|
||||
|
||||
<!-- 본인인증서비스 요청 form --------------------------->
|
||||
<form name="reqKMCISForm" method="post" action="#">
|
||||
<input type="hidden" name="tr_cert" value = "${tr_cert}">
|
||||
<input type="hidden" name="tr_url" value = "${tr_url}">
|
||||
<input type="hidden" name="tr_add" value = "${tr_add}">
|
||||
<input type="submit" value="본인인증서비스 요청" onclick= "javascript:openKMCISWindow();">
|
||||
</form>
|
||||
|
||||
|
||||
</c:when>
|
||||
<c:when test="${param.actionType eq 'PHONE_ADD'}">
|
||||
|
||||
<!-- 본인인증서비스 요청 form --------------------------->
|
||||
<form name="reqKMCISForm" method="post" action="#">
|
||||
<input type="hidden" name="tr_cert" value = "${tr_cert}">
|
||||
<input type="hidden" name="tr_url" value = "${tr_url}">
|
||||
<input type="hidden" name="tr_add" value = "${tr_add}">
|
||||
<input type="submit" value="본인인증서비스 요청" onclick= "javascript:openKMCISWindow();">
|
||||
</form>
|
||||
|
||||
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
|
||||
<!-- 본인인증서비스 요청 form --------------------------->
|
||||
<form name="reqKMCISForm" method="post" action="#">
|
||||
<input type="hidden" name="tr_cert" value = "${tr_cert}">
|
||||
<input type="hidden" name="tr_url" value = "${tr_url}">
|
||||
<input type="hidden" name="tr_add" value = "${tr_add}">
|
||||
<input type="submit" value="본인인증서비스 요청" onclick= "javascript:openKMCISWindow();">
|
||||
</form>
|
||||
|
||||
|
||||
<!-- wrap : s -->
|
||||
<div class="wrap pageSmall">
|
||||
<div class="container">
|
||||
<div id="contents">
|
||||
<!-- 상세 : s -->
|
||||
<div class="headerConts">
|
||||
<h1 class="logo"><a href="/">로고</a></h1>
|
||||
</div>
|
||||
<div class="innerConts">
|
||||
<!-- certifyWrap : s -->
|
||||
<div class="certifyWrap left">
|
||||
<dl class="formList">
|
||||
<dt>회원정보 입력</dt>
|
||||
<dd>
|
||||
<ul class="inpField">
|
||||
<li class="certify">
|
||||
<input type="text" class="inpText" value="" disabled>
|
||||
<span class="btnCertify">인증완료</span>
|
||||
</li>
|
||||
<li>
|
||||
<input type="text" class="inpText" value="홍길동" disabled>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dd class="error"><!-- 인풋 입력이 에러일 경우 클래스 'error' 추가 -->
|
||||
<input type="text" class="inpText" placeholder="메일주소">
|
||||
<span class="errorMsg">메일주소를 입력해 주세요.</span>
|
||||
</dd>
|
||||
<dd>
|
||||
<input type="password" class="inpText" placeholder="비밀번호">
|
||||
</dd>
|
||||
<dd>
|
||||
<input type="password" class="inpText" placeholder="비밀번호 확인">
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl class="guideList">
|
||||
<dt>비밀번호는 8-30자의 영문 대소문자, 숫자, 특수문자를 조합하여 입력해주세요.</dt>
|
||||
<dd>4회 이상 반복된 문구와 숫자 사용 불가<br>계정(휴대폰 번호)과 4자리 이상 동일한 숫자 사용 불가</dd>
|
||||
</dl>
|
||||
|
||||
<div class="agreeList">
|
||||
<div class="item all">
|
||||
<span class="inputCheckbox">
|
||||
<input type="checkbox" name="check01" id="check01">
|
||||
<label for="check01">모두 동의</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="inputCheckbox">
|
||||
<input type="checkbox" name="check02" id="check02">
|
||||
<label for="check02">이용약관 동의</label>
|
||||
</span>
|
||||
<a href="#" class="btnView">보기</a>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="inputCheckbox">
|
||||
<input type="checkbox" name="check03" id="check03">
|
||||
<label for="check03">개인정보 처리방침 동의</label>
|
||||
</span>
|
||||
<a href="#" class="btnView">보기</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btnArea">
|
||||
<a href="#" class="btns btnCol01 disabled"><!-- 입력 완료시 클래스 'disabled' 제거-->
|
||||
<span>회원가입 완료</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- certifyWrap : e -->
|
||||
</div>
|
||||
<!-- 상세 : e -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- wrap : e -->
|
||||
<!-- certifyWrap : e -->
|
||||
|
||||
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
<script>
|
||||
openKMCISWindow();
|
||||
</script>
|
||||
<jsp:include page="/WEB-INF/view/include/inc_portal_body_footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,95 +0,0 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<jsp:include page="/WEB-INF/view/include/inc_head.jsp"/>
|
||||
<jsp:include page="/WEB-INF/view/include/inc_head_script.jsp"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<c:if test="${resultCert.success}">
|
||||
<%-- #### 성공한 경우 처리!!! --%>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
(function() {
|
||||
var UserAgent = navigator.userAgent;
|
||||
|
||||
var isMobile = false;
|
||||
|
||||
/* 모바일 접근 체크*/
|
||||
// 모바일일 경우 (변동사항 있을경우 추가 필요)
|
||||
if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) {
|
||||
//document.kmcis_form.submit();
|
||||
isMobile = true;
|
||||
}
|
||||
|
||||
<c:choose>
|
||||
<c:when test="${resultCert.plusInfo eq 'PHONE_UPDATE'}">
|
||||
if (isMobile) {
|
||||
location.href = '/portal/update-phone';
|
||||
} else {
|
||||
opener.callbackPhoneUpdate();
|
||||
self.close();
|
||||
}
|
||||
</c:when>
|
||||
<c:when test="${resultCert.plusInfo eq 'PHONE_ADD'}">
|
||||
if (isMobile) {
|
||||
location.href = '/portal/update-phone';
|
||||
} else {
|
||||
opener.callbackPhoneAdd();
|
||||
self.close();
|
||||
}
|
||||
</c:when>
|
||||
<c:when test="${resultCert.plusInfo eq 'FIND_UID'}">
|
||||
if (isMobile) {
|
||||
//TODO: 원페이지의경우 처리이슈 있음
|
||||
opener.callbackCert();
|
||||
self.close();
|
||||
} else {
|
||||
opener.callbackCert();
|
||||
self.close();
|
||||
}
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
if (isMobile) {
|
||||
location.href = '/home/user/join';
|
||||
} else {
|
||||
opener.callbackCert();
|
||||
self.close();
|
||||
}
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
</c:if>
|
||||
|
||||
|
||||
<c:if test="${resultCert.fail}">
|
||||
<%-- #### 실패한 경우 처리!!! --%>
|
||||
|
||||
<p> 인증에 실패하였습니다. </p>
|
||||
<p>${resultCert.errorMessage}</p>
|
||||
|
||||
<script>
|
||||
alert('${resultCert.errorMessage}');
|
||||
self.close();
|
||||
</script>
|
||||
|
||||
</c:if>
|
||||
|
||||
|
||||
<%--
|
||||
<form id="kmcis_form" name="kmcis_form" method="post" action="/">
|
||||
<input type="hidden" name="rec_cert" id="rec_cert" value="<%=rec_cert%>"/>
|
||||
<input type="hidden" name="certNum" id="certNum" value="<%=certNum%>"/>
|
||||
</form>
|
||||
--%>
|
||||
|
||||
<jsp:include page="/WEB-INF/view/include/inc_portal_body_footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,172 +0,0 @@
|
||||
<%
|
||||
//************************************************************************
|
||||
// //
|
||||
// 본 샘플소스는 개발 및 테스트를 위한 목적으로 만들어졌으며, //
|
||||
// //
|
||||
// 실제 서비스에 그대로 사용하는 것을 금합니다. //
|
||||
// //
|
||||
//************************************************************************
|
||||
%>
|
||||
<%
|
||||
response.setHeader("Pragma","no-cache"); // HTTP1.0 캐쉬 방지
|
||||
response.setDateHeader("Expires",0); // proxy 서버의 캐쉬 방지
|
||||
response.setHeader("Pragma", "no-store"); // HTTP1.1 캐쉬 방지
|
||||
if(request.getProtocol().equals("HTTP/1.1"))
|
||||
response.setHeader("Cache-Control", "no-cache"); // HTTP1.1 캐쉬 방지
|
||||
%>
|
||||
<%@ page contentType = "text/html;charset=ksc5601"%>
|
||||
<%@ page import ="java.util.*,java.text.SimpleDateFormat"%>
|
||||
<%
|
||||
//날짜 생성
|
||||
Calendar today = Calendar.getInstance();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String day = sdf.format(today.getTime());
|
||||
|
||||
java.util.Random ran = new Random();
|
||||
//랜덤 문자 길이
|
||||
int numLength = 6;
|
||||
String randomStr = "";
|
||||
|
||||
for (int i = 0; i < numLength; i++) {
|
||||
//0 ~ 9 랜덤 숫자 생성
|
||||
randomStr += ran.nextInt(10);
|
||||
}
|
||||
|
||||
//reqNum은 최대 40byte 까지 사용 가능
|
||||
String reqNum = day + randomStr;
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title>본인인증서비스 테스트</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
|
||||
<meta name="robots" content="noindex">
|
||||
<style>
|
||||
<!--
|
||||
body,p,ol,ul,td
|
||||
{
|
||||
font-family: 굴림;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
a:link { size:9px;color:#000000;text-decoration: none; line-height: 12px}
|
||||
a:visited { size:9px;color:#555555;text-decoration: none; line-height: 12px}
|
||||
a:hover { color:#ff9900;text-decoration: none; line-height: 12px}
|
||||
|
||||
.style1 {
|
||||
color: #6b902a;
|
||||
font-weight: bold;
|
||||
}
|
||||
.style2 {
|
||||
color: #666666
|
||||
}
|
||||
.style3 {
|
||||
color: #3b5d00;
|
||||
font-weight: bold;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>
|
||||
<center>
|
||||
<br><br><br>
|
||||
<span class="style1">본인인증서비스 테스트</span><br>
|
||||
|
||||
<form name="reqForm" method="post" action="./euckr_kmcis_web_sample_step02.jsp">
|
||||
<table cellpadding=1 cellspacing=1>
|
||||
<tr>
|
||||
<td align=center>회원사ID</td>
|
||||
<td align=left><input type="text" name="cpId" size='41' maxlength ='10' value = ""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>URL코드</td>
|
||||
<td align=left><input type="text" name="urlCode" size='41' maxlength ='6' value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>요청번호</td>
|
||||
<td align=left><input type="text" name="certNum" size='41' maxlength ='40' value='<%=reqNum%>'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>요청일시</td>
|
||||
<!-- 현재시각 세팅(YYYYMMDDHI24MISS) -->
|
||||
<td align=left><input type="text" name="date" size="41" maxlength ='14' value="<%=day%>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>본인인증방법</td>
|
||||
<td align=left>
|
||||
<select name="certMet" style="width:300">
|
||||
<option value="A">인증방법선택 화면</option>
|
||||
<option value="M"selected>휴대폰인증 화면</option>
|
||||
<option value="C">신용카드인증 화면</option>
|
||||
<option value="P">공인인증서 화면</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이용자성명</td>
|
||||
<td align=left><input type="text" name="name" size="41" maxlength ='20' value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>휴대폰번호</td>
|
||||
<td align=left>
|
||||
<input type="text" name="phoneNo" id="textfield" style="width:160px;" class="hpinput" maxlength="11"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이통사</td>
|
||||
<td align=left>
|
||||
<input type="radio" name="phoneCorp" id="radio" value="SKT"> SKT
|
||||
<input type="radio" name="phoneCorp" id="radio" value="KTF"> KT
|
||||
<input type="radio" name="phoneCorp" id="radio" value="LGT"> LG U+
|
||||
<input type="radio" name="phoneCorp" id="radio" value="SKM"> SKTmvno
|
||||
<input type="radio" name="phoneCorp" id="radio" value="KTM"> KTmvno
|
||||
<input type="radio" name="phoneCorp" id="radio" value="LGM"> LGU+mvno
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>생년월일</td>
|
||||
<td align=left>
|
||||
<input type="text" name="birthDay" id="textfield" style="width:160px;" class="hpinput" maxlength="8"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이용자성별</td>
|
||||
<td align=left><input type="radio" name="gender" id="radio" value="0"> 남 <input type="radio" name="gender" id="radio" value="1"> 여</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>내외국인</td>
|
||||
<td align=left>
|
||||
<select name="nation" id="select" style="width:160px;">
|
||||
<option value = "">-선택-</a>
|
||||
<option value = "0">내국인</a>
|
||||
<option value = "1">외국인</a>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>추가DATA정보</td>
|
||||
<td align=left><input type="text" name="plusInfo" size="41" maxlength ='320' value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>결과수신URL</td>
|
||||
<td align=left><input type="text" name="tr_url" size="41" value="http://회원사별 경로/kmcis_web_sample_step03.jsp"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>IFrame사용여부</td>
|
||||
<td align=left>
|
||||
<select name="tr_add" style="width:300">
|
||||
<option value="N"selected>미사용</option>
|
||||
<option value="Y">사용</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br><br>
|
||||
<input type="submit" value="본인인증 테스트">
|
||||
</form>
|
||||
<br>
|
||||
<br>
|
||||
이 Sample화면은 본인인증서비스 테스트를 위해 제공하고 있는 화면입니다.<br>
|
||||
<br>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,361 +0,0 @@
|
||||
<%
|
||||
//************************************************************************
|
||||
// //
|
||||
// 본 샘플소스는 개발 및 테스트를 위한 목적으로 만들어졌으며, //
|
||||
// //
|
||||
// 실제 서비스에 그대로 사용하는 것을 금합니다. //
|
||||
// //
|
||||
//************************************************************************
|
||||
%>
|
||||
<%
|
||||
response.setHeader("Pragma", "no-cache" );
|
||||
response.setDateHeader("Expires", 0);
|
||||
response.setHeader("Pragma", "no-store");
|
||||
response.setHeader("Cache-Control", "no-cache" );
|
||||
%>
|
||||
<%@ page contentType = "text/html;charset=ksc5601"%>
|
||||
<%@ page import = "java.util.*" %>
|
||||
<%@ page import = "java.util.regex.*" %>
|
||||
<%@ page import = "java.text.*" %>
|
||||
<%
|
||||
//tr_cert 데이터 변수 선언 ---------------------------------------------------------------
|
||||
String tr_cert = "";
|
||||
String cpId = request.getParameter("cpId"); // 회원사ID
|
||||
String urlCode = request.getParameter("urlCode"); // URL코드
|
||||
String certNum = request.getParameter("certNum"); // 요청번호 ( 본인인증 요청시 중복되지 않게 생성해야함. (예-시퀀스번호) )
|
||||
String date = request.getParameter("date"); // 요청일시
|
||||
String certMet = request.getParameter("certMet"); // 본인인증방법
|
||||
String name = request.getParameter("name"); // 성명
|
||||
String phoneNo = request.getParameter("phoneNo"); // 휴대폰번호
|
||||
String phoneCorp = request.getParameter("phoneCorp"); // 이동통신사
|
||||
if(phoneCorp == null) phoneCorp = "";
|
||||
String birthDay = request.getParameter("birthDay"); // 생년월일
|
||||
String gender = request.getParameter("gender"); // 성별
|
||||
if(gender == null) gender = "";
|
||||
String nation = request.getParameter("nation"); // 내외국인 구분
|
||||
String plusInfo = request.getParameter("plusInfo"); // 추가DATA정보
|
||||
String extendVar = "0000000000000000"; // 확장변수
|
||||
//End-tr_cert 데이터 변수 선언 ---------------------------------------------------------------
|
||||
|
||||
String tr_url = request.getParameter("tr_url"); // 본인인증서비스 결과수신 POPUP URL
|
||||
String tr_add = request.getParameter("tr_add"); // IFrame사용여부
|
||||
|
||||
%>
|
||||
<%!
|
||||
// 파라미터 유효성 검증 --------------------------------------------
|
||||
boolean b = true;
|
||||
String regex = "";
|
||||
String regex1 = "";
|
||||
|
||||
public Boolean paramChk(String patn, String param){
|
||||
Pattern pattern = Pattern.compile(patn);
|
||||
Matcher matcher = pattern.matcher(param);
|
||||
b = matcher.matches();
|
||||
return b;
|
||||
}
|
||||
%>
|
||||
<%
|
||||
/*
|
||||
regex = "[A-Z]*";
|
||||
regex1 = "[0-9]*";
|
||||
if( cpId.length() == 8 ){
|
||||
String engcpId = cpId.substring(0,4);
|
||||
String numcpId = cpId.substring(4,8);
|
||||
if( !paramChk(regex, engcpId) || !paramChk(regex1, numcpId) ){
|
||||
out.println("<script> alert('회원사ID 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
} else {
|
||||
out.println("<script> alert('회원사ID 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( urlCode.length() != 6 || !paramChk(regex, urlCode) ){
|
||||
out.println("<script> alert('URL코드 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
if( certNum.length() == 0 || certNum.length() > 40){
|
||||
out.println("<script> alert('요청번호를 입력하세요.');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( date.length() != 14 || !paramChk(regex, date) ){
|
||||
out.println("<script> alert('요청일시 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[A-Z]*";
|
||||
if( certMet.length() != 1 || !paramChk(regex, certMet) ){
|
||||
out.println("<script> alert('본인인증방법 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( phoneNo.length() != 0 ){
|
||||
if( (phoneNo.length() != 10 && phoneNo.length() != 11) || !paramChk(regex, phoneNo) ){
|
||||
out.println("<script> alert('휴대폰번호 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[A-Z]*";
|
||||
if( phoneCorp.length() != 0 ){
|
||||
if( phoneCorp.length() != 3 || !paramChk(regex, phoneCorp) ){
|
||||
out.println("<script> alert('이동통신사 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( birthDay.length() != 0 ){
|
||||
if( birthDay.length() != 8 || !paramChk(regex, birthDay) ){
|
||||
out.println("<script> alert('생년월일 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( gender.length() != 0 ){
|
||||
if( gender.length() != 1 || !paramChk(regex, gender) ){
|
||||
out.println("<script> alert('성별 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( nation.length() != 0 ){
|
||||
if( nation.length() != 1 || !paramChk(regex, nation) ){
|
||||
out.println("<script> alert('내/외국인 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[\\sA-Za-z가-힣.,-]*";
|
||||
if( name.length() != 0 ){
|
||||
if( name.length() > 60 || !paramChk(regex, name) ){
|
||||
out.println("<script> alert('성명 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
if( tr_url.length() == 0 ){
|
||||
out.println("<script> alert('결과수신 URL 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[A-Z]*";
|
||||
if( tr_add.length() != 0 ){
|
||||
if( tr_add.length() != 1 || !paramChk(regex, tr_add) ){
|
||||
out.println("<script> alert('IFrame사용여부 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// END 파라미터 유효성 검증 --------------------------------------------
|
||||
|
||||
//01. 한국모바일인증(주) 암호화 모듈 선언
|
||||
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||
|
||||
//02. 1차 암호화 (tr_cert 데이터변수 조합 후 암호화)
|
||||
String enc_tr_cert = "";
|
||||
tr_cert = cpId +"/"+ urlCode +"/"+ certNum +"/"+ date +"/"+ certMet +"/"+ birthDay +"/"+ gender +"/"+ name +"/"+ phoneNo +"/"+ phoneCorp +"/"+ nation +"/"+ plusInfo +"/"+ extendVar;
|
||||
enc_tr_cert = seed.getEnc(tr_cert, "");
|
||||
|
||||
//03. 1차 암호화 데이터에 대한 위변조 검증값 생성 (HMAC)
|
||||
String hmacMsg = "";
|
||||
hmacMsg = seed.getMsg(enc_tr_cert);
|
||||
|
||||
//04. 2차 암호화 (1차 암호화 데이터, HMAC 데이터, extendVar 조합 후 암호화)
|
||||
tr_cert = seed.getEnc(enc_tr_cert + "/" + hmacMsg + "/" + extendVar, "");
|
||||
%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>본인인증서비스 Sample 화면</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
|
||||
<meta name="robots" content="noindex">
|
||||
<style>
|
||||
<!--
|
||||
body,p,ol,ul,td
|
||||
{
|
||||
font-family: 굴림;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
a:link { size:9px;color:#000000;text-decoration: none; line-height: 12px}
|
||||
a:visited { size:9px;color:#555555;text-decoration: none; line-height: 12px}
|
||||
a:hover { color:#ff9900;text-decoration: none; line-height: 12px}
|
||||
|
||||
.style1 {
|
||||
color: #6b902a;
|
||||
font-weight: bold;
|
||||
}
|
||||
.style2 {
|
||||
color: #666666
|
||||
}
|
||||
.style3 {
|
||||
color: #3b5d00;
|
||||
font-weight: bold;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
|
||||
<script language=javascript>
|
||||
<!--
|
||||
window.name = "kmcis_web_sample";
|
||||
|
||||
var KMCIS_window;
|
||||
|
||||
function openKMCISWindow(){
|
||||
|
||||
var UserAgent = navigator.userAgent;
|
||||
/* 모바일 접근 체크*/
|
||||
// 모바일일 경우 (변동사항 있을경우 추가 필요)
|
||||
if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) {
|
||||
document.reqKMCISForm.target = '';
|
||||
}
|
||||
|
||||
// 모바일이 아닐 경우
|
||||
else {
|
||||
KMCIS_window = window.open('', 'KMCISWindow', 'width=425, height=550, resizable=0, scrollbars=no, status=0, titlebar=0, toolbar=0, left=435, top=250' );
|
||||
|
||||
if(KMCIS_window == null){
|
||||
alert(" ※ 윈도우 XP SP2 또는 인터넷 익스플로러 7 사용자일 경우에는 \n 화면 상단에 있는 팝업 차단 알림줄을 클릭하여 팝업을 허용해 주시기 바랍니다. \n\n※ MSN,야후,구글 팝업 차단 툴바가 설치된 경우 팝업허용을 해주시기 바랍니다.");
|
||||
}
|
||||
|
||||
document.reqKMCISForm.target = 'KMCISWindow';
|
||||
}
|
||||
|
||||
document.reqKMCISForm.action = 'https://www.kmcert.com/kmcis/web/kmcisReq.jsp';
|
||||
document.reqKMCISForm.submit();
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF" topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>
|
||||
|
||||
<center>
|
||||
<br><br><br><br><br><br>
|
||||
<span class="style1">본인인증서비스 요청화면 Sample입니다.</span><br>
|
||||
<br><br>
|
||||
<table cellpadding=1 cellspacing=1>
|
||||
<tr>
|
||||
<td align=center>회원사ID</td>
|
||||
<td align=left><%=cpId%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>URL코드</td>
|
||||
<td align=left><%=urlCode%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>요청번호</td>
|
||||
<td align=left><%=certNum%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>요청일시</td>
|
||||
<td align=left><%=date%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>본인인증방법</td>
|
||||
<td align=left><%=certMet%></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이용자성명</td>
|
||||
<td align=left><%=name%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>휴대폰번호</td>
|
||||
<td align=left><%=phoneNo%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이동통신사</td>
|
||||
<td align=left><%=phoneCorp%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>생년월일</td>
|
||||
<td align=left><%=birthDay%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이용자성별</td>
|
||||
<td align=left><%=gender%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>내외국인</td>
|
||||
<td align=left><%=nation%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>추가DATA정보</td>
|
||||
<td align=left><%=plusInfo%></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center> </td>
|
||||
<td align=left> </td>
|
||||
</tr>
|
||||
<tr width=100>
|
||||
<td align=center>요청정보(암호화)</td>
|
||||
<td align=left>
|
||||
<%=tr_cert.substring(0,50)%>...
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>결과수신URL</td>
|
||||
<td align=left><%=tr_url%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>IFrame사용여부</td>
|
||||
<td align=left><%=tr_add%></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- 본인인증서비스 요청 form --------------------------->
|
||||
<form name="reqKMCISForm" method="post" action="#">
|
||||
<input type="hidden" name="tr_cert" value = "<%=tr_cert%>">
|
||||
<input type="hidden" name="tr_url" value = "<%=tr_url%>">
|
||||
<input type="hidden" name="tr_add" value = "<%=tr_add%>">
|
||||
<input type="submit" value="본인인증서비스 요청" onclick= "javascript:openKMCISWindow();">
|
||||
</form>
|
||||
<BR>
|
||||
<BR>
|
||||
<!--End 본인인증서비스 요청 form ----------------------->
|
||||
|
||||
<br>
|
||||
<br>
|
||||
이 Sample화면은 본인인증서비스 요청화면 개발시 참고가 되도록 제공하고 있는 화면입니다.<br>
|
||||
<br>
|
||||
</center>
|
||||
</BODY>
|
||||
</HTML>er>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,69 +0,0 @@
|
||||
<%
|
||||
//************************************************************************
|
||||
// //
|
||||
// 본 샘플소스는 개발 및 테스트를 위한 목적으로 만들어졌으며, //
|
||||
// //
|
||||
// 실제 서비스에 그대로 사용하는 것을 금합니다. //
|
||||
// //
|
||||
//************************************************************************
|
||||
%>
|
||||
<%
|
||||
response.setHeader("Pragma","no-cache"); // HTTP1.0 캐쉬 방지
|
||||
response.setDateHeader("Expires",0); // proxy 서버의 캐쉬 방지
|
||||
response.setHeader("Pragma", "no-store"); // HTTP1.1 캐쉬 방지
|
||||
if(request.getProtocol().equals("HTTP/1.1"))
|
||||
response.setHeader("Cache-Control", "no-cache"); // HTTP1.1 캐쉬 방지
|
||||
%>
|
||||
<%@ page contentType = "text/html;charset=ksc5601"%>
|
||||
<%@ page import = "java.util.*" %>
|
||||
<%@ page import = "java.util.regex.*" %>
|
||||
<%@ page import = "java.text.*" %>
|
||||
<%
|
||||
|
||||
String rec_cert = ""; // 결과값(암호화)
|
||||
String certNum = ""; // certNum
|
||||
|
||||
rec_cert = request.getParameter("rec_cert").trim();
|
||||
certNum = request.getParameter("certNum").trim();
|
||||
|
||||
// 파라미터 유효성 검증
|
||||
if( rec_cert.length() == 0 || certNum.length() == 0 ){
|
||||
out.println("<script> alert('결과값 비정상');");
|
||||
return;
|
||||
}
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="robots" content="noindex">
|
||||
<script type="text/javascript">
|
||||
var move_page_url = "http://회원사별 경로/kmcis_web_sample_step04.jsp";
|
||||
|
||||
|
||||
function end() {
|
||||
var UserAgent = navigator.userAgent;
|
||||
|
||||
// 결과 페이지 경로 셋팅
|
||||
document.kmcis_form.action = move_page_url;
|
||||
|
||||
/* 모바일 접근 체크*/
|
||||
// 모바일일 경우 (변동사항 있을경우 추가 필요)
|
||||
if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) {
|
||||
document.kmcis_form.submit();
|
||||
}
|
||||
|
||||
// 모바일이 아닐 경우
|
||||
else {
|
||||
document.kmcis_form.target = opener.window.name;
|
||||
document.kmcis_form.submit();
|
||||
self.close();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="javascript:end()">
|
||||
<form id="kmcis_form" name="kmcis_form" method="post">
|
||||
<input type="hidden" name="rec_cert" id="rec_cert" value="<%=rec_cert%>"/>
|
||||
<input type="hidden" name="certNum" id="certNum" value="<%=certNum%>"/>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,176 +0,0 @@
|
||||
<%
|
||||
//************************************************************************
|
||||
// //
|
||||
// 본 샘플소스는 개발 및 테스트를 위한 목적으로 만들어졌으며, //
|
||||
// //
|
||||
// 실제 서비스에 그대로 사용하는 것을 금합니다. //
|
||||
// //
|
||||
//************************************************************************
|
||||
%>
|
||||
<%
|
||||
response.setHeader("Pragma","no-cache"); // HTTP1.0 캐쉬 방지
|
||||
response.setDateHeader("Expires",0); // proxy 서버의 캐쉬 방지
|
||||
response.setHeader("Pragma", "no-store"); // HTTP1.1 캐쉬 방지
|
||||
if(request.getProtocol().equals("HTTP/1.1"))
|
||||
response.setHeader("Cache-Control", "no-cache"); // HTTP1.1 캐쉬 방지
|
||||
%>
|
||||
<%@ page contentType = "text/html;charset=UTF-8"%>
|
||||
<%@ page import ="java.util.*,java.text.SimpleDateFormat"%>
|
||||
<%
|
||||
final String SERVER_URL = "https://lanedu.ga";
|
||||
|
||||
//날짜 생성
|
||||
Calendar today = Calendar.getInstance();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String day = sdf.format(today.getTime());
|
||||
|
||||
java.util.Random ran = new Random();
|
||||
//랜덤 문자 길이
|
||||
int numLength = 6;
|
||||
String randomStr = "";
|
||||
|
||||
for (int i = 0; i < numLength; i++) {
|
||||
//0 ~ 9 랜덤 숫자 생성
|
||||
randomStr += ran.nextInt(10);
|
||||
}
|
||||
|
||||
//reqNum은 최대 40byte 까지 사용 가능
|
||||
String reqNum = day + randomStr;
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>본인인증서비스 테스트</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex">
|
||||
<style>
|
||||
<!--
|
||||
body,p,ol,ul,td
|
||||
{
|
||||
font-family: 굴림;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
a:link { size:9px;color:#000000;text-decoration: none; line-height: 12px}
|
||||
a:visited { size:9px;color:#555555;text-decoration: none; line-height: 12px}
|
||||
a:hover { color:#ff9900;text-decoration: none; line-height: 12px}
|
||||
|
||||
.style1 {
|
||||
color: #6b902a;
|
||||
font-weight: bold;
|
||||
}
|
||||
.style2 {
|
||||
color: #666666
|
||||
}
|
||||
.style3 {
|
||||
color: #3b5d00;
|
||||
font-weight: bold;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>
|
||||
<center>
|
||||
<br><br><br>
|
||||
<span class="style1">본인인증서비스 테스트</span><br>
|
||||
|
||||
<form name="reqForm" method="post" action="./kmcis_web_sample_step02.jsp">
|
||||
<table cellpadding=1 cellspacing=1>
|
||||
<tr>
|
||||
<td align=center>회원사ID</td>
|
||||
<td align=left><input type="text" name="cpId" size='41' maxlength ='10' value = "KBZM1052"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>URL코드</td>
|
||||
<td align=left><input type="text" name="urlCode" size='41' maxlength ='6' value="MKBZM1052000"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>요청번호</td>
|
||||
<td align=left><input type="text" name="certNum" size='41' maxlength ='40' value='<%=reqNum%>'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>요청일시</td>
|
||||
<!-- 현재시각 세팅(YYYYMMDDHI24MISS) -->
|
||||
<td align=left><input type="text" name="date" size="41" maxlength ='14' value="<%=day%>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>본인인증방법</td>
|
||||
<td align=left>
|
||||
<select name="certMet" style="width:300">
|
||||
<option value="A">인증방법선택 화면</option>
|
||||
<option value="M"selected>휴대폰인증 화면</option>
|
||||
<option value="C">신용카드인증 화면</option>
|
||||
<option value="P">공인인증서 화면</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이용자성명</td>
|
||||
<td align=left><input type="text" name="name" size="41" maxlength ='20' value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>휴대폰번호</td>
|
||||
<td align=left>
|
||||
<input type="text" name="phoneNo" id="textfield" style="width:160px;" class="hpinput" maxlength="11"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이통사</td>
|
||||
<td align=left>
|
||||
<input type="radio" name="phoneCorp" id="radio1" value="SKT"> SKT
|
||||
<input type="radio" name="phoneCorp" id="radio2" value="KTF"> KT
|
||||
<input type="radio" name="phoneCorp" id="radio3" value="LGT"> LG U+
|
||||
<input type="radio" name="phoneCorp" id="radio4" value="SKM"> SKTmvno
|
||||
<input type="radio" name="phoneCorp" id="radio5" value="KTM"> KTmvno
|
||||
<input type="radio" name="phoneCorp" id="radio6" value="LGM"> LGU+mvno
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>생년월일</td>
|
||||
<td align=left>
|
||||
<input type="text" name="birthDay" id="textfield" style="width:160px;" class="hpinput" maxlength="8"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이용자성별</td>
|
||||
<td align=left><input type="radio" name="gender" id="radio" value="0"> 남 <input type="radio" name="gender" id="radio" value="1"> 여</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>내외국인</td>
|
||||
<td align=left>
|
||||
<select name="nation" id="select" style="width:160px;">
|
||||
<option value = "">-선택-</a>
|
||||
<option value = "0">내국인</a>
|
||||
<option value = "1">외국인</a>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>추가DATA정보</td>
|
||||
<td align=left><input type="text" name="plusInfo" size="41" maxlength ='320' value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>결과수신URL</td>
|
||||
<td align=left><input type="text" name="tr_url" size="41" value="<%=SERVER_URL%>/icert/kmcis_web_sample_step03.jsp"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>IFrame사용여부</td>
|
||||
<td align=left>
|
||||
<select name="tr_add" style="width:300">
|
||||
<option value="N"selected>미사용</option>
|
||||
<option value="Y">사용</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br><br>
|
||||
<input type="submit" value="본인인증 테스트">
|
||||
</form>
|
||||
<br>
|
||||
<br>
|
||||
이 Sample화면은 본인인증서비스 테스트를 위해 제공하고 있는 화면입니다.<br>
|
||||
<br>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,361 +0,0 @@
|
||||
<%
|
||||
//************************************************************************
|
||||
// //
|
||||
// 본 샘플소스는 개발 및 테스트를 위한 목적으로 만들어졌으며, //
|
||||
// //
|
||||
// 실제 서비스에 그대로 사용하는 것을 금합니다. //
|
||||
// //
|
||||
//************************************************************************
|
||||
%>
|
||||
<%
|
||||
response.setHeader("Pragma", "no-cache" );
|
||||
response.setDateHeader("Expires", 0);
|
||||
response.setHeader("Pragma", "no-store");
|
||||
response.setHeader("Cache-Control", "no-cache" );
|
||||
%>
|
||||
<%@ page contentType = "text/html;charset=UTF-8"%>
|
||||
<%@ page import = "java.util.*" %>
|
||||
<%@ page import = "java.util.regex.*" %>
|
||||
<%@ page import = "java.text.*" %>
|
||||
<%
|
||||
//tr_cert 데이터 변수 선언 ---------------------------------------------------------------
|
||||
String tr_cert = "";
|
||||
String cpId = request.getParameter("cpId"); // 회원사ID
|
||||
String urlCode = request.getParameter("urlCode"); // URL코드
|
||||
String certNum = request.getParameter("certNum"); // 요청번호 ( 본인인증 요청시 중복되지 않게 생성해야함. (예-시퀀스번호) )
|
||||
String date = request.getParameter("date"); // 요청일시
|
||||
String certMet = request.getParameter("certMet"); // 본인인증방법
|
||||
String name = request.getParameter("name"); // 성명
|
||||
String phoneNo = request.getParameter("phoneNo"); // 휴대폰번호
|
||||
String phoneCorp = request.getParameter("phoneCorp"); // 이동통신사
|
||||
if(phoneCorp == null) phoneCorp = "";
|
||||
String birthDay = request.getParameter("birthDay"); // 생년월일
|
||||
String gender = request.getParameter("gender"); // 성별
|
||||
if(gender == null) gender = "";
|
||||
String nation = request.getParameter("nation"); // 내외국인 구분
|
||||
String plusInfo = request.getParameter("plusInfo"); // 추가DATA정보
|
||||
String extendVar = "0000000000000000"; // 확장변수
|
||||
//End-tr_cert 데이터 변수 선언 ---------------------------------------------------------------
|
||||
|
||||
String tr_url = request.getParameter("tr_url"); // 본인인증서비스 결과수신 POPUP URL
|
||||
String tr_add = request.getParameter("tr_add"); // IFrame사용여부
|
||||
|
||||
%>
|
||||
<%!
|
||||
// 파라미터 유효성 검증 --------------------------------------------
|
||||
boolean b = true;
|
||||
String regex = "";
|
||||
String regex1 = "";
|
||||
|
||||
public Boolean paramChk(String patn, String param){
|
||||
Pattern pattern = Pattern.compile(patn);
|
||||
Matcher matcher = pattern.matcher(param);
|
||||
b = matcher.matches();
|
||||
return b;
|
||||
}
|
||||
%>
|
||||
<%
|
||||
/*
|
||||
regex = "[A-Z]*";
|
||||
regex1 = "[0-9]*";
|
||||
if( cpId.length() == 8 ){
|
||||
String engcpId = cpId.substring(0,4);
|
||||
String numcpId = cpId.substring(4,8);
|
||||
if( !paramChk(regex, engcpId) || !paramChk(regex1, numcpId) ){
|
||||
out.println("<script> alert('회원사ID 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
} else {
|
||||
out.println("<script> alert('회원사ID 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( urlCode.length() != 6 || !paramChk(regex, urlCode) ){
|
||||
out.println("<script> alert('URL코드 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
if( certNum.length() == 0 || certNum.length() > 40){
|
||||
out.println("<script> alert('요청번호를 입력하세요.');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( date.length() != 14 || !paramChk(regex, date) ){
|
||||
out.println("<script> alert('요청일시 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[A-Z]*";
|
||||
if( certMet.length() != 1 || !paramChk(regex, certMet) ){
|
||||
out.println("<script> alert('본인인증방법 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( phoneNo.length() != 0 ){
|
||||
if( (phoneNo.length() != 10 && phoneNo.length() != 11) || !paramChk(regex, phoneNo) ){
|
||||
out.println("<script> alert('휴대폰번호 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[A-Z]*";
|
||||
if( phoneCorp.length() != 0 ){
|
||||
if( phoneCorp.length() != 3 || !paramChk(regex, phoneCorp) ){
|
||||
out.println("<script> alert('이동통신사 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( birthDay.length() != 0 ){
|
||||
if( birthDay.length() != 8 || !paramChk(regex, birthDay) ){
|
||||
out.println("<script> alert('생년월일 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( gender.length() != 0 ){
|
||||
if( gender.length() != 1 || !paramChk(regex, gender) ){
|
||||
out.println("<script> alert('성별 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[0-9]*";
|
||||
if( nation.length() != 0 ){
|
||||
if( nation.length() != 1 || !paramChk(regex, nation) ){
|
||||
out.println("<script> alert('내/외국인 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[\\sA-Za-z가-�R.,-]*";
|
||||
if( name.length() != 0 ){
|
||||
if( name.length() > 60 || !paramChk(regex, name) ){
|
||||
out.println("<script> alert('성명 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
if( tr_url.length() == 0 ){
|
||||
out.println("<script> alert('결과수신 URL 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
regex = "[A-Z]*";
|
||||
if( tr_add.length() != 0 ){
|
||||
if( tr_add.length() != 1 || !paramChk(regex, tr_add) ){
|
||||
out.println("<script> alert('IFrame사용여부 비정상');");
|
||||
out.println("history.back(); </script>");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// END 파라미터 유효성 검증 --------------------------------------------
|
||||
|
||||
//01. 한국모바일인증(주) 암호화 모듈 선언
|
||||
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||
|
||||
//02. 1차 암호화 (tr_cert 데이터변수 조합 후 암호화)
|
||||
String enc_tr_cert = "";
|
||||
tr_cert = cpId +"/"+ urlCode +"/"+ certNum +"/"+ date +"/"+ certMet +"/"+ birthDay +"/"+ gender +"/"+ name +"/"+ phoneNo +"/"+ phoneCorp +"/"+ nation +"/"+ plusInfo +"/"+ extendVar;
|
||||
enc_tr_cert = seed.getEnc(tr_cert, "");
|
||||
|
||||
//03. 1차 암호화 데이터에 대한 위변조 검증값 생성 (HMAC)
|
||||
String hmacMsg = "";
|
||||
hmacMsg = seed.getMsg(enc_tr_cert);
|
||||
|
||||
//04. 2차 암호화 (1차 암호화 데이터, HMAC 데이터, extendVar 조합 후 암호화)
|
||||
tr_cert = seed.getEnc(enc_tr_cert + "/" + hmacMsg + "/" + extendVar, "");
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>본인인증서비스 Sample 화면</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex">
|
||||
<style>
|
||||
<!--
|
||||
body,p,ol,ul,td
|
||||
{
|
||||
font-family: 굴림;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
a:link { size:9px;color:#000000;text-decoration: none; line-height: 12px}
|
||||
a:visited { size:9px;color:#555555;text-decoration: none; line-height: 12px}
|
||||
a:hover { color:#ff9900;text-decoration: none; line-height: 12px}
|
||||
|
||||
.style1 {
|
||||
color: #6b902a;
|
||||
font-weight: bold;
|
||||
}
|
||||
.style2 {
|
||||
color: #666666
|
||||
}
|
||||
.style3 {
|
||||
color: #3b5d00;
|
||||
font-weight: bold;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
|
||||
<script language=javascript>
|
||||
<!--
|
||||
window.name = "kmcis_web_sample";
|
||||
|
||||
var KMCIS_window;
|
||||
|
||||
function openKMCISWindow(){
|
||||
|
||||
var UserAgent = navigator.userAgent;
|
||||
/* 모바일 접근 체크*/
|
||||
// 모바일일 경우 (변동사항 있을경우 추가 필요)
|
||||
if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) {
|
||||
document.reqKMCISForm.target = '';
|
||||
}
|
||||
|
||||
// 모바일이 아닐 경우
|
||||
else {
|
||||
KMCIS_window = window.open('', 'KMCISWindow', 'width=425, height=550, resizable=0, scrollbars=no, status=0, titlebar=0, toolbar=0, left=435, top=250' );
|
||||
|
||||
if(KMCIS_window == null){
|
||||
alert(" ※ 윈도우 XP SP2 또는 인터넷 익스플로러 7 사용자일 경우에는 \n 화면 상단에 있는 팝업 차단 알림줄을 클릭하여 팝업을 허용해 주시기 바랍니다. \n\n※ MSN,야후,구글 팝업 차단 툴바가 설치된 경우 팝업허용을 해주시기 바랍니다.");
|
||||
}
|
||||
|
||||
document.reqKMCISForm.target = 'KMCISWindow';
|
||||
}
|
||||
|
||||
document.reqKMCISForm.action = 'https://www.kmcert.com/kmcis/web/kmcisReq.jsp';
|
||||
document.reqKMCISForm.submit();
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF" topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>
|
||||
|
||||
<center>
|
||||
<br><br><br><br><br><br>
|
||||
<span class="style1">본인인증서비스 요청화면 Sample입니다.</span><br>
|
||||
<br><br>
|
||||
<table cellpadding=1 cellspacing=1>
|
||||
<tr>
|
||||
<td align=center>회원사ID</td>
|
||||
<td align=left><%=cpId%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>URL코드</td>
|
||||
<td align=left><%=urlCode%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>요청번호</td>
|
||||
<td align=left><%=certNum%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>요청일시</td>
|
||||
<td align=left><%=date%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>본인인증방법</td>
|
||||
<td align=left><%=certMet%></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이용자성명</td>
|
||||
<td align=left><%=name%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>휴대폰번호</td>
|
||||
<td align=left><%=phoneNo%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이동통신사</td>
|
||||
<td align=left><%=phoneCorp%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>생년월일</td>
|
||||
<td align=left><%=birthDay%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>이용자성별</td>
|
||||
<td align=left><%=gender%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>내외국인</td>
|
||||
<td align=left><%=nation%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>추가DATA정보</td>
|
||||
<td align=left><%=plusInfo%></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center> </td>
|
||||
<td align=left> </td>
|
||||
</tr>
|
||||
<tr width=100>
|
||||
<td align=center>요청정보(암호화)</td>
|
||||
<td align=left>
|
||||
<%=tr_cert.substring(0,50)%>...
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>결과수신URL</td>
|
||||
<td align=left><%=tr_url%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>IFrame사용여부</td>
|
||||
<td align=left><%=tr_add%></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- 본인인증서비스 요청 form --------------------------->
|
||||
<form name="reqKMCISForm" method="post" action="#">
|
||||
<input type="hidden" name="tr_cert" value = "<%=tr_cert%>">
|
||||
<input type="hidden" name="tr_url" value = "<%=tr_url%>">
|
||||
<input type="hidden" name="tr_add" value = "<%=tr_add%>">
|
||||
<input type="submit" value="본인인증서비스 요청" onclick= "javascript:openKMCISWindow();">
|
||||
</form>
|
||||
<BR>
|
||||
<BR>
|
||||
<!--End 본인인증서비스 요청 form ----------------------->
|
||||
|
||||
<br>
|
||||
<br>
|
||||
이 Sample화면은 본인인증서비스 요청화면 개발시 참고가 되도록 제공하고 있는 화면입니다.<br>
|
||||
<br>
|
||||
</center>
|
||||
</BODY>
|
||||
</HTML>er>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,70 +0,0 @@
|
||||
<%
|
||||
//************************************************************************
|
||||
// //
|
||||
// 본 샘플소스는 개발 및 테스트를 위한 목적으로 만들어졌으며, //
|
||||
// //
|
||||
// 실제 서비스에 그대로 사용하는 것을 금합니다. //
|
||||
// //
|
||||
//************************************************************************
|
||||
%>
|
||||
<%
|
||||
response.setHeader("Pragma","no-cache"); // HTTP1.0 캐쉬 방지
|
||||
response.setDateHeader("Expires",0); // proxy 서버의 캐쉬 방지
|
||||
response.setHeader("Pragma", "no-store"); // HTTP1.1 캐쉬 방지
|
||||
if(request.getProtocol().equals("HTTP/1.1"))
|
||||
response.setHeader("Cache-Control", "no-cache"); // HTTP1.1 캐쉬 방지
|
||||
%>
|
||||
<%@ page contentType = "text/html;charset=UTF-8"%>
|
||||
<%@ page import = "java.util.*" %>
|
||||
<%@ page import = "java.util.regex.*" %>
|
||||
<%@ page import = "java.text.*" %>
|
||||
<%
|
||||
|
||||
String rec_cert = ""; // 결과값(암호화)
|
||||
String certNum = ""; // certNum
|
||||
|
||||
rec_cert = request.getParameter("rec_cert").trim();
|
||||
certNum = request.getParameter("certNum").trim();
|
||||
|
||||
// 파라미터 유효성 검증
|
||||
if( rec_cert.length() == 0 || certNum.length() == 0 ){
|
||||
out.println("<script> alert('결과값 비정상');");
|
||||
return;
|
||||
}
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex">
|
||||
<script type="text/javascript">
|
||||
var move_page_url = "http://회원사별 경로/kmcis_web_sample_step04.jsp";
|
||||
|
||||
function end() {
|
||||
var UserAgent = navigator.userAgent;
|
||||
|
||||
// 결과 페이지 경로 셋팅
|
||||
document.kmcis_form.action = move_page_url;
|
||||
|
||||
/* 모바일 접근 체크*/
|
||||
// 모바일일 경우 (변동사항 있을경우 추가 필요)
|
||||
if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) {
|
||||
document.kmcis_form.submit();
|
||||
}
|
||||
|
||||
// 모바일이 아닐 경우
|
||||
else {
|
||||
document.kmcis_form.target = opener.window.name;
|
||||
document.kmcis_form.submit();
|
||||
self.close();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="javascript:end()">
|
||||
<form id="kmcis_form" name="kmcis_form" method="post">
|
||||
<input type="hidden" name="rec_cert" id="rec_cert" value="<%=rec_cert%>"/>
|
||||
<input type="hidden" name="certNum" id="certNum" value="<%=certNum%>"/>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,383 +0,0 @@
|
||||
<%
|
||||
//************************************************************************
|
||||
// //
|
||||
// 본 샘플소스는 개발 및 테스트를 위한 목적으로 만들어졌으며, //
|
||||
// //
|
||||
// 실제 서비스에 그대로 사용하는 것을 금합니다. //
|
||||
// //
|
||||
//************************************************************************
|
||||
%>
|
||||
<%
|
||||
response.setHeader("Pragma","no-cache"); // HTTP1.0 캐쉬 방지
|
||||
response.setDateHeader("Expires",0); // proxy 서버의 캐쉬 방지
|
||||
response.setHeader("Pragma", "no-store"); // HTTP1.1 캐쉬 방지
|
||||
if(request.getProtocol().equals("HTTP/1.1"))
|
||||
response.setHeader("Cache-Control", "no-cache"); // HTTP1.1 캐쉬 방지
|
||||
%>
|
||||
<%@ page contentType = "text/html;charset=ksc5601"%>
|
||||
<%@ page import = "java.util.*" %>
|
||||
<%@ page import = "java.util.regex.*" %>
|
||||
<%@ page import = "java.text.*" %>
|
||||
[본인인증서비스 테스트 결과 수신 Sample] <br> <br>
|
||||
<%
|
||||
// 변수선언 --------------------------------------------------------------------------------------------------------
|
||||
String rec_cert = ""; // 결과수신DATA
|
||||
|
||||
String k_certNum = ""; // 파라미터로 수신한 요청번호
|
||||
String certNum = ""; // 요청번호
|
||||
String date = ""; // 요청일시
|
||||
String CI = ""; // 연계정보(CI)
|
||||
String DI = ""; // 중복가입확인정보(DI)
|
||||
String phoneNo = ""; // 휴대폰번호
|
||||
String phoneCorp = ""; // 이동통신사
|
||||
String birthDay = ""; // 생년월일
|
||||
String gender = ""; // 성별
|
||||
String nation = ""; // 내국인
|
||||
String name = ""; // 성명
|
||||
String M_name = ""; // 미성년자 성명
|
||||
String M_birthDay = ""; // 미성년자 생년월일
|
||||
String M_Gender = ""; // 미성년자 성별
|
||||
String M_nation = ""; // 미성년자 내외국인
|
||||
String result = ""; // 결과값
|
||||
|
||||
String certMet = ""; // 인증방법
|
||||
String ip = ""; // ip주소
|
||||
String plusInfo = "";
|
||||
|
||||
String encPara = "";
|
||||
String encMsg1 = "";
|
||||
String encMsg2 = "";
|
||||
String msgChk = "";
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
try{
|
||||
|
||||
// Parameter 수신 --------------------------------------------------------------------
|
||||
rec_cert = request.getParameter("rec_cert").trim();
|
||||
k_certNum = request.getParameter("certNum").trim();
|
||||
|
||||
%>
|
||||
[복호화 하기전 수신값] <br>
|
||||
<br>
|
||||
rec_cert : <%=rec_cert%> <br>
|
||||
<br>
|
||||
<%
|
||||
//01. 암호화 모듈 (jar) Loading
|
||||
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||
|
||||
//02. 1차 복호화
|
||||
//수신된 certNum를 이용하여 복호화
|
||||
rec_cert = seed.getDec(rec_cert, k_certNum);
|
||||
|
||||
//03. 1차 파싱
|
||||
int inf1 = rec_cert.indexOf("/",0);
|
||||
int inf2 = rec_cert.indexOf("/",inf1+1);
|
||||
|
||||
encPara = rec_cert.substring(0,inf1); //암호화된 통합 파라미터
|
||||
encMsg1 = rec_cert.substring(inf1+1,inf2); //암호화된 통합 파라미터의 Hash값
|
||||
|
||||
//04. 위변조 검증
|
||||
encMsg2 = seed.getMsg(encPara);
|
||||
|
||||
if(encMsg2.equals(encMsg1)){
|
||||
msgChk="Y";
|
||||
}
|
||||
|
||||
if(msgChk.equals("N")){
|
||||
%>
|
||||
<script language=javascript>
|
||||
alert("비정상적인 접근입니다.!!<%=msgChk%>");
|
||||
</script>
|
||||
<%
|
||||
return;
|
||||
}
|
||||
|
||||
//05. 2차 복호화
|
||||
rec_cert = seed.getDec(encPara, k_certNum);
|
||||
|
||||
//06. 2차 파싱
|
||||
int info1 = rec_cert.indexOf("/",0);
|
||||
int info2 = rec_cert.indexOf("/",info1+1);
|
||||
int info3 = rec_cert.indexOf("/",info2+1);
|
||||
int info4 = rec_cert.indexOf("/",info3+1);
|
||||
int info5 = rec_cert.indexOf("/",info4+1);
|
||||
int info6 = rec_cert.indexOf("/",info5+1);
|
||||
int info7 = rec_cert.indexOf("/",info6+1);
|
||||
int info8 = rec_cert.indexOf("/",info7+1);
|
||||
int info9 = rec_cert.indexOf("/",info8+1);
|
||||
int info10 = rec_cert.indexOf("/",info9+1);
|
||||
int info11 = rec_cert.indexOf("/",info10+1);
|
||||
int info12 = rec_cert.indexOf("/",info11+1);
|
||||
int info13 = rec_cert.indexOf("/",info12+1);
|
||||
int info14 = rec_cert.indexOf("/",info13+1);
|
||||
int info15 = rec_cert.indexOf("/",info14+1);
|
||||
int info16 = rec_cert.indexOf("/",info15+1);
|
||||
int info17 = rec_cert.indexOf("/",info16+1);
|
||||
int info18 = rec_cert.indexOf("/",info17+1);
|
||||
|
||||
certNum = rec_cert.substring(0,info1);
|
||||
date = rec_cert.substring(info1+1,info2);
|
||||
CI = rec_cert.substring(info2+1,info3);
|
||||
phoneNo = rec_cert.substring(info3+1,info4);
|
||||
phoneCorp = rec_cert.substring(info4+1,info5);
|
||||
birthDay = rec_cert.substring(info5+1,info6);
|
||||
gender = rec_cert.substring(info6+1,info7);
|
||||
nation = rec_cert.substring(info7+1,info8);
|
||||
name = rec_cert.substring(info8+1,info9);
|
||||
result = rec_cert.substring(info9+1,info10);
|
||||
certMet = rec_cert.substring(info10+1,info11);
|
||||
ip = rec_cert.substring(info11+1,info12);
|
||||
M_name = rec_cert.substring(info12+1,info13);
|
||||
M_birthDay = rec_cert.substring(info13+1,info14);
|
||||
M_Gender = rec_cert.substring(info14+1,info15);
|
||||
M_nation = rec_cert.substring(info15+1,info16);
|
||||
plusInfo = rec_cert.substring(info16+1,info17);
|
||||
DI = rec_cert.substring(info17+1,info18);
|
||||
|
||||
//07. CI, DI 복호화
|
||||
CI = seed.getDec(CI, k_certNum);
|
||||
DI = seed.getDec(DI, k_certNum);
|
||||
%>
|
||||
<%!
|
||||
// 파라미터 유효성 검증 --------------------------------------------
|
||||
boolean b = true;
|
||||
String regex = "";
|
||||
|
||||
public Boolean paramChk(String patn, String param){
|
||||
Pattern pattern = Pattern.compile(patn);
|
||||
Matcher matcher = pattern.matcher(param);
|
||||
b = matcher.matches();
|
||||
return b;
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if( certNum.length() == 0 || certNum.length() > 40){
|
||||
out.println("요청번호 비정상");
|
||||
return;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( date.length() != 14 || !paramChk(regex, date) ){
|
||||
out.println("요청일시 비정상");
|
||||
return;
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if( certMet.length() != 1 || !paramChk(regex, certMet) ){
|
||||
out.println("본인인증방법 비정상" + certMet);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( (phoneNo.length() != 10 && phoneNo.length() != 11) || !paramChk(regex, phoneNo) ){
|
||||
out.println("휴대폰번호 비정상");
|
||||
return;
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if( phoneCorp.length() != 3 || !paramChk(regex, phoneCorp) ){
|
||||
out.println("이동통신사 비정상");
|
||||
return;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( birthDay.length() != 8 || !paramChk(regex, birthDay) ){
|
||||
out.println("생년월일 비정상");
|
||||
return;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( gender.length() != 1 || !paramChk(regex, gender) ){
|
||||
out.println("성별 비정상");
|
||||
return;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( nation.length() != 1 || !paramChk(regex, nation) ){
|
||||
out.println("내/외국인 비정상");
|
||||
return;
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-힣.,-]*";
|
||||
if( name.length() > 60 || !paramChk(regex, name) ){
|
||||
out.println("성명 비정상");
|
||||
return;
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if( result.length() != 1 || !paramChk(regex, result) ){
|
||||
out.println("결과값 비정상");
|
||||
return;
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-?.,-]*";
|
||||
if( M_name.length() != 0 ){
|
||||
if( M_name.length() > 60 || !paramChk(regex, M_name) ){
|
||||
out.println("미성년자 성명 비정상");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( M_birthDay.length() != 0 ){
|
||||
if( M_birthDay.length() != 8 || !paramChk(regex, M_birthDay) ){
|
||||
out.println("미성년자 생년월일 비정상");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( M_Gender.length() != 0 ){
|
||||
if( M_Gender.length() != 1 || !paramChk(regex, M_Gender) ){
|
||||
out.println("미성년자 성별 비정상");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( M_nation.length() != 0 ){
|
||||
if( M_nation.length() != 1 || !paramChk(regex, M_nation) ){
|
||||
out.println("미성년자 내/외국인 비정상");
|
||||
return;
|
||||
}
|
||||
}
|
||||
// End 파라미터 유효성 검증 --------------------------------------------
|
||||
|
||||
// Start - 수신내역 유효성 검증(사설망의 사설 IP로 인해 미사용, 공용망의 경우 확인 후 사용) *********************/
|
||||
// 1. date 값 검증
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss",Locale.KOREAN); // 현재 서버 시각 구하기
|
||||
String strCurrentTime = formatter.format(new Date());
|
||||
|
||||
Date toDate = formatter.parse(strCurrentTime);
|
||||
Date fromDate = formatter.parse(date);
|
||||
long timediff = toDate.getTime()-fromDate.getTime();
|
||||
|
||||
if ( timediff < -30*60*1000 || 30*60*100 < timediff ){ %>
|
||||
비정상적인 접근입니다. (요청시간경과)
|
||||
<% return;
|
||||
}
|
||||
|
||||
// 2. ip 값 검증
|
||||
String client_ip = request.getHeader("HTTP_X_FORWARDED_FOR"); // 사용자IP 구하기
|
||||
if ( client_ip != null ){
|
||||
if( client_ip.indexOf(",") != -1 )
|
||||
client_ip = client_ip.substring(0,client_ip.indexOf(","));
|
||||
}
|
||||
if ( client_ip==null || client_ip.length()==0 ){
|
||||
client_ip = request.getRemoteAddr();
|
||||
}
|
||||
|
||||
if( !client_ip.equals(ip) ){ %>
|
||||
|
||||
비정상적인 접근입니다. (IP불일치)
|
||||
<% return;
|
||||
}
|
||||
// End - 수신내역 유효성 검증(사설망의 사설 IP로 인해 미사용, 공용망의 경우 확인 후 사용) ***********************/
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="robots" content="noindex">
|
||||
</head>
|
||||
<body>
|
||||
<br><br>
|
||||
[복호화 후 수신값] <br>
|
||||
<br>
|
||||
<table cellpadding=1 cellspacing=1>
|
||||
<tr>
|
||||
<td align=left>위,변조여부1</td>
|
||||
<td align=left><%=encMsg1%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>위,변조여부2</td>
|
||||
<td align=left><%=encMsg2%></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align=left>요청번호</td>
|
||||
<td align=left><%=certNum%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>요청일시</td>
|
||||
<td align=left><%=date%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>연계정보(CI)</td>
|
||||
<td align=left><%=CI%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>중복가입확인정보(DI)</td>
|
||||
<td align=left><%=DI%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>휴대폰번호</td>
|
||||
<td align=left><%=phoneNo%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>이동통신사</td>
|
||||
<td align=left><%=phoneCorp%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>생년월일</td>
|
||||
<td align=left><%=birthDay%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>내국인</td>
|
||||
<td align=left><%=nation%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>성별</td>
|
||||
<td align=left><%=gender%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>성명</td>
|
||||
<td align=left><%=name%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>결과값</td>
|
||||
<td align=left><%=result%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>인증방법</td>
|
||||
<td align=left><%=certMet%></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>ip주소</td>
|
||||
<td align=left><%=ip%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>미성년자 성명</td>
|
||||
<td align=left><%=M_name%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>미성년자 생년월일</td>
|
||||
<td align=left><%=M_birthDay%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>미성년자 성별</td>
|
||||
<td align=left><%=M_Gender%></td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>미성년자 내외국인</td>
|
||||
<td align=left><%=M_nation%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left>추가DATA정보</td>
|
||||
<td align=left><%=plusInfo%></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
rec_cert : <%=rec_cert%> <br>
|
||||
<br>
|
||||
<br>
|
||||
<a href="http://회원사별 경로/kmcis_web_sample_step01.jsp">[다시 테스트]</a>
|
||||
</body>
|
||||
</html>
|
||||
<%
|
||||
}catch(Exception ex){
|
||||
System.out.println("[KMCIS] Receive Error -"+ex.getMessage());
|
||||
}
|
||||
%>
|
||||
Reference in New Issue
Block a user