NHN_KCP 휴대폰 본인인증 설정 가맹점 인증키 추가
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -14,12 +14,15 @@ $web_siteid = '';
|
||||
if ($config['cf_cert_use'] == 2) { // 실서비스
|
||||
$site_cd = 'SM'.$config['cf_cert_kcp_cd'];
|
||||
$cert_url = 'https://cert.kcp.co.kr/kcp_cert/cert_view.jsp';
|
||||
$kcp_enc_key = $config['cf_cert_kcp_enckey'];
|
||||
} else if ($config['cf_cert_use'] == 1) { // 테스트사용
|
||||
$site_cd = 'S6186';
|
||||
$cert_url = 'https://testcert.kcp.co.kr/kcp_cert/cert_view.jsp';
|
||||
$kcp_enc_key = 'E66DCEB95BFBD45DF9DFAEEBCB092B5DC2EB3BF0';
|
||||
} else { // 사용안함
|
||||
$site_cd = '';
|
||||
$cert_url = '';
|
||||
$kcp_enc_key = '';
|
||||
}
|
||||
|
||||
if(!$site_cd)
|
||||
|
||||
@ -27,6 +27,8 @@ if(!$ordr_idxx)
|
||||
$ct_cert = new C_CT_CLI;
|
||||
$ct_cert->mf_clear();
|
||||
|
||||
$sbParam = '';
|
||||
|
||||
$year = "00";
|
||||
$month = "00";
|
||||
$day = "00";
|
||||
@ -47,7 +49,7 @@ $hash_data = $site_cd .
|
||||
$sex_code .
|
||||
$local_code;
|
||||
|
||||
$up_hash = $ct_cert->make_hash_data( $home_dir, $hash_data );
|
||||
$up_hash = $ct_cert->make_hash_data( $home_dir, $kcp_enc_key, $hash_data );
|
||||
|
||||
$ct_cert->mf_clear();
|
||||
?>
|
||||
@ -88,6 +90,9 @@ $ct_cert->mf_clear();
|
||||
<!-- cert_enc_use 필수 (고정값 : 메뉴얼 참고) -->
|
||||
<input type="hidden" name="cert_enc_use" value="Y"/>
|
||||
|
||||
<!-- 리턴 암호화 고도화 -->
|
||||
<input type="hidden" name="cert_enc_use_ext" value="Y"/>
|
||||
|
||||
<?php if(is_mobile()) { ?>
|
||||
<!-- cert_able_yn input 비활성화 설정 -->
|
||||
<input type="hidden" name="cert_able_yn" value=""/>
|
||||
@ -101,10 +106,15 @@ $ct_cert->mf_clear();
|
||||
<!-- up_hash 검증 을 위한 필드 -->
|
||||
<input type="hidden" name="veri_up_hash" value=""/>
|
||||
|
||||
<!-- web_siteid 을 위한 필드 -->
|
||||
<input type="hidden" name="web_siteid_hashYN" value=""/>
|
||||
|
||||
<!-- 가맹점 사용 필드 (인증완료시 리턴)-->
|
||||
<input type="hidden" name="param_opt_1" value="opt1"/>
|
||||
<input type="hidden" name="param_opt_2" value="opt2"/>
|
||||
<input type="hidden" name="param_opt_3" value="opt3"/>
|
||||
|
||||
<input type='hidden' name='kcp_cert_lib_ver' value="<?php echo $ct_cert->get_kcp_lib_ver( $home_dir ); ?>"/>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
||||
@ -12,6 +12,7 @@ $enc_data = "";
|
||||
$req_tx = "";
|
||||
|
||||
$enc_cert_data = "";
|
||||
$enc_cert_data2 = "";
|
||||
$cert_info = "";
|
||||
|
||||
$tran_cd = "";
|
||||
@ -67,6 +68,11 @@ for($i=0; $i<count($key); $i++)
|
||||
{
|
||||
$enc_cert_data = f_get_parm_str ( $valParam );
|
||||
}
|
||||
|
||||
if ( $nmParam == "enc_cert_data2" )
|
||||
{
|
||||
$enc_cert_data2 = f_get_parm_str ( $valParam );
|
||||
}
|
||||
|
||||
if ( $nmParam == "dn_hash" )
|
||||
{
|
||||
@ -98,7 +104,7 @@ if( $cert_enc_use == "Y" )
|
||||
// 해당 데이터의 위변조를 방지합니다
|
||||
$veri_str = $site_cd.$ordr_idxx.$cert_no; // 사이트 코드 + 주문번호 + 인증거래번호
|
||||
|
||||
if ( $ct_cert->check_valid_hash ( $home_dir , $dn_hash , $veri_str ) != "1" )
|
||||
if ( $ct_cert->check_valid_hash ( $home_dir , $kcp_enc_key, $dn_hash , $veri_str ) != "1" )
|
||||
{
|
||||
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
||||
// 검증 실패시 처리 영역
|
||||
@ -122,7 +128,7 @@ if( $cert_enc_use == "Y" )
|
||||
// site_cd 와 cert_no 를 가지고 복화화 하는 함수 입니다.
|
||||
// 정상적으로 복호화 된경우에만 인증데이터를 가져올수 있습니다.
|
||||
$opt = "1" ; // 복호화 인코딩 옵션 ( UTF - 8 사용시 "1" )
|
||||
$ct_cert->decrypt_enc_cert( $home_dir , $site_cd , $cert_no , $enc_cert_data , $opt );
|
||||
$ct_cert->decrypt_enc_cert( $home_dir , $kcp_enc_key, $site_cd , $cert_no , $enc_cert_data2 , $opt );
|
||||
|
||||
$comm_id = $ct_cert->mf_get_key_value("comm_id" ); // 이동통신사 코드
|
||||
$phone_no = $ct_cert->mf_get_key_value("phone_no" ); // 전화번호
|
||||
|
||||
@ -20,7 +20,7 @@ class C_CT_CLI
|
||||
}
|
||||
|
||||
// hash 처리 영역
|
||||
function make_hash_data( $home_dir , $str )
|
||||
function make_hash_data( $home_dir , $key , $str )
|
||||
{
|
||||
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
||||
if(PHP_INT_MAX == 2147483647) // 32-bit
|
||||
@ -32,6 +32,7 @@ class C_CT_CLI
|
||||
}
|
||||
$hash_data = $this -> mf_exec( $bin_exe ,
|
||||
"lf_CT_CLI__make_hash_data",
|
||||
$key,
|
||||
$str
|
||||
);
|
||||
|
||||
@ -41,7 +42,7 @@ class C_CT_CLI
|
||||
}
|
||||
|
||||
// dn_hash 체크 함수
|
||||
function check_valid_hash ($home_dir , $hash_data , $str )
|
||||
function check_valid_hash ($home_dir , $key , $hash_data , $str )
|
||||
{
|
||||
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
||||
if(PHP_INT_MAX == 2147483647) // 32-bit
|
||||
@ -53,6 +54,7 @@ class C_CT_CLI
|
||||
}
|
||||
$ret_val = $this -> mf_exec( $bin_exe ,
|
||||
"lf_CT_CLI__check_valid_hash" ,
|
||||
$key,
|
||||
$hash_data ,
|
||||
$str
|
||||
);
|
||||
@ -63,7 +65,7 @@ class C_CT_CLI
|
||||
}
|
||||
|
||||
// 암호화 인증데이터 복호화
|
||||
function decrypt_enc_cert ( $home_dir, $site_cd , $cert_no , $enc_cert_data , $opt)
|
||||
function decrypt_enc_cert ( $home_dir, $key , $site_cd , $cert_no , $enc_cert_data , $opt)
|
||||
{
|
||||
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
||||
if(PHP_INT_MAX == 2147483647) // 32-bit
|
||||
@ -73,6 +75,7 @@ class C_CT_CLI
|
||||
|
||||
$dec_data = $this -> mf_exec( $bin_exe ,
|
||||
"lf_CT_CLI__decrypt_enc_cert" ,
|
||||
$key,
|
||||
$site_cd ,
|
||||
$cert_no ,
|
||||
$enc_cert_data ,
|
||||
@ -84,6 +87,7 @@ class C_CT_CLI
|
||||
|
||||
$dec_data = $this -> mf_exec( $bin_exe ,
|
||||
"lf_CT_CLI__decrypt_enc_cert" ,
|
||||
$key,
|
||||
$site_cd ,
|
||||
$cert_no ,
|
||||
$enc_cert_data
|
||||
@ -96,6 +100,26 @@ class C_CT_CLI
|
||||
parse_str( str_replace( chr( 31 ), "&", $dec_data ), $this->m_dec_data );
|
||||
}
|
||||
|
||||
function get_kcp_lib_ver( $home_dir )
|
||||
{
|
||||
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
||||
if(PHP_INT_MAX == 2147483647) // 32-bit
|
||||
$bin_exe = $home_dir . '/bin/ct_cli';
|
||||
else
|
||||
$bin_exe = $home_dir . '/bin/ct_cli_x64';
|
||||
} else {
|
||||
$bin_exe = $home_dir . '/bin/ct_cli_exe.exe';
|
||||
}
|
||||
|
||||
$ver_data = $this -> mf_exec( $bin_exe ,
|
||||
"lf_CT_CLI__get_kcp_lib_ver"
|
||||
);
|
||||
|
||||
if ( $ver_data == "" ) { $ver_data = "HS04"; }
|
||||
|
||||
return $ver_data;
|
||||
}
|
||||
|
||||
// 인증데이터 get data
|
||||
function mf_get_key_value( $name )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user