1 |
- var _USMessage={NoticeDownload:"\uc571\uc774 \uc124\uce58\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc744 \uacbd\uc6b0\n\uc124\uce58\ud398\uc774\uc9c0\ub85c \uc774\ub3d9\ud569\ub2c8\ub2e4.",ConfirmDownload:"\uc571 \uc124\uce58 \ud6c4 \uc774\uc6a9 \uac00\ub2a5\ud569\ub2c8\ub2e4.\n\uc124\uce58 \ud398\uc774\uc9c0\ub85c \uc774\ub3d9\ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?",NoticeUnsupportedOS:"\uc9c0\uc6d0\ud558\uc9c0 \uc54a\ub294 \uc6b4\uc601\uccb4\uc81c\uc785\ub2c8\ub2e4."},_test={countWindows:function(){alert("windows count : "+safari.application.browserWindows)}},UniSignW2A={Scheme:{iOS:"unisign-app",Android:"crosscert"},Package:{Android:"com.crosscert.android"},DownloadURL:{iOS:"https://itunes.apple.com/kr/app/gong-in-injeungsenteo/id426081742?mt=8",Android:"market://details?id=com.crosscert.android"},AutoCheckInstallation:!0,UseTopLocation:!1,checkCrossCert:function(a){if(_USUtil.OS.isAndroid())alert(_USMessage.NoticeDownload),top.location.href=_USUtil.makeIntent(this.Scheme.Android,"init","isInit","true");else if(_USUtil.OS.isiOS()){if(0!=this.AutoCheckInstallation||null==a||0==a.length){if(null==a||0==a.length)a=this.Scheme.iOS+"://?cmd=Main&caller_url_scheme="+location.href+"&callback=01";var b=+new Date;setTimeout(function(){1600>+new Date-b&&UniSignW2A.moveToStore()},1500)}top.location.href=a}else alert(_USMessage.NoticeUnsupportedOS)},moveToStore:function(){_USUtil.OS.isAndroid()?top.location.href=this.DownloadURL.Android:_USUtil.OS.isiOS()?top.location.href=this.DownloadURL.iOS:alert(_USMessage.NoticeUnsupportedOS)},getLicenseInfo:function(a){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"licenseinfo","requestCode","2","retURL",a),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"LicenseInfo","caller_url_scheme",a,"callback","01"),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},manageCert:function(a,b){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"mngmt","requestCode","1","retURL",a,"rtnParam",b),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"ManageCert","caller_url_scheme",a,"callback",b),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},importCert:function(a,b,c){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"import","requestCode","3","retURL",a,"appkey",b,"rtnParam",c),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"ImportCert","caller_url_scheme",a,"appkey",b,"callback",c),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},importCertWithShow:function(a,b,c){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"import","requestCode","3","retURL",a,"appkey",b,"rtnParam",c),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"ImportCertEx","caller_url_scheme",a,"appkey",b,"callback",c),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},exportCert:function(a,b,c){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"export","requestCode","4","retURL",a,"appkey",b,"rtnParam",c),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"ExportCert","caller_url_scheme",a,"appkey",b,"callback",c),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},exportCertWithShow:function(a,b,c){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"export","requestCode","4","retURL",a,"appkey",b,"rtnParam",c),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"ExportCertEx","caller_url_scheme",a,"appkey",b,"callback",c),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},issueCert:function(a,b){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"issue","requestCode","5","retURL",a,"rtnParam",b),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"IssueCert","caller_url_scheme",a,"callback",b),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},renewCert:function(a,b){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"renew","requestCode","6","retURL",a,"rtnParam",b),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"UpdateCert","caller_url_scheme",a,"callback",b),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},disuseCert:function(a,b){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"disuse","requestCode","7","retURL",a,"rtnParam",b),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"RevokeCert","caller_url_scheme",a,"callback",b),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},esign:function(a,b,c,d,e,f){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"esign","requestCode","8","retURL",a,"appkey",b,"data",_USUtil.Base64.encode(c),"rtnParam",d,"sidOption",e,"sidValue",f),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"SignedData","caller_url_scheme",a,"appkey",b,"data",_USUtil.Base64.encode(c),"callback",d,"sidOption",e,"sidValue",f),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},esignWithShow:function(a,b,c,d,e,f){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"esign","requestCode","8","retURL",a,"appkey",b,"data",_USUtil.Base64.encode(c),"rtnParam",d,"sidOption",e,"sidValue",f),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"SignedDataEx","caller_url_scheme",a,"appkey",b,"data",_USUtil.Base64.encode(c),"callback",d,"sidOption",e,"sidValue",f),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},vidr:function(a,b,c,d,e){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"vidr","requestCode","12","retURL",a,"appkey",b,"rtnParam",c,"sidOption",d,"sidValue",e),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"VIDR","caller_url_scheme",a,"appkey",b,"callback",c,"sidOption",d,"sidValue",e),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},etax:function(a,b,c,d,e){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"etax","requestCode","10","retURL",a,"appkey",b,"data",c,"option",d,"rtnParam",e),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"Etax","caller_url_scheme",a,"appkey",b,"data",c,"option",d,"callback",e),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)}},VeriSign={Scheme:{iOS:"unisignv-app",Android:"crosscertv"},Package:{Android:"com.crosscertv.android"},DownloadURL:{iOS:"https://itunes.apple.com/kr/app/verisigninjeungsenteo/id495605308?mt=8",Android:"market://details?id=com.crosscertv.android"},AutoCheckInstallation:!0,checkCrossCert:function(a){if(_USUtil.OS.isAndroid())alert(_USMessage.NoticeDownload),top.location.href=_USUtil.makeIntent(this.Scheme.Android,"init","isInit","true");else if(_USUtil.OS.isiOS()){if(0!=this.AutoCheckInstallation||null==a||0==a.length){if(null==a||0==a.length)a=this.Scheme.iOS+"://?cmd=Main&caller_url_scheme="+location.href+"&callback=01";var b=+new Date;setTimeout(function(){1600>+new Date-b&&(confirm(_USMessage.ConfirmDownload)?VeriSign.moveToStore():console.debug("confirm cancel"))},1500)}top.location.href=a}else alert(_USMessage.NoticeUnsupportedOS)},moveToStore:function(){_USUtil.OS.isAndroid()?top.location.href=this.DownloadURL.Android:_USUtil.OS.isiOS()?top.location.href=this.DownloadURL.iOS:alert(_USMessage.NoticeUnsupportedOS)},getLicenseInfo:function(a){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"licenseinfo","requestCode","2","retURL",a),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"LicenseInfo","caller_url_scheme",a,"callback","01"),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},importCert:function(a,b,c){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"import","requestCode","3","retURL",a,"appkey",b,"rtnParam",c),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"ImportCert","caller_url_scheme",a,"appkey",b,"callback",c),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)},esign:function(a,b,c,d,e,f){_USUtil.OS.isAndroid()?(a=_USUtil.makeIntent(this.Scheme.Android,"esign","requestCode","8","retURL",a,"appkey",b,"data",_USUtil.Base64.encode(c),"rtnParam",d,"sidOption",e,"sidValue",f),top.location.href=a):_USUtil.OS.isiOS()?(a=_USUtil.makeCustomScheme(this.Scheme.iOS,"SignedData","caller_url_scheme",a,"appkey",b,"data",_USUtil.Base64.encode(c),"callback",d,"sidOption",e,"sidValue",f),this.checkCrossCert(a)):alert(_USMessage.NoticeUnsupportedOS)}},_USUtil={OS:{UserAgent:{Android_Phone:"Android",Android_Pad:"Android",iPhone:"iPhone",iPad:"iPad"},isAndroid:function(){return-1<navigator.userAgent.indexOf(this.UserAgent.Android_Phone)?!0:!1},isiOS:function(){return-1<navigator.userAgent.indexOf(this.UserAgent.iPhone)||-1<navigator.userAgent.indexOf(this.UserAgent.iPad)?!0:!1},isSupported:function(){return this.isAndroid()||this.isiOS()?!0:!1}},makeIntent:function(){if(!1!==this.OS.isAndroid()&&!(4>arguments.length)){for(var a="intent://"+arguments[1],b="",c=1;2*c<arguments.length;c++)b=0>=b.length?b+("?"+arguments[2*c]+"="+arguments[2*c+1]):b+("&"+arguments[2*c]+"="+arguments[2*c+1]);if(UniSignW2A.Scheme.Android===arguments[0])c="#Intent;scheme="+UniSignW2A.Scheme.Android+";action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package="+UniSignW2A.Package.Android+";end";else if(VeriSign.Scheme.Android===arguments[0])c="#Intent;scheme="+VeriSign.Scheme.Android+";action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package="+VeriSign.Package.Android+";end";else return;return a+b+c}},makeCustomScheme:function(){if(!1!==_USUtil.OS.isiOS()&&!(4>arguments.length)){for(var a=arguments[0]+"://?cmd="+arguments[1],b="",c=1;2*c<arguments.length;c++)b+="&"+arguments[2*c]+"="+arguments[2*c+1];return a+b+""}},getQueryVariable:function(a){for(var b=window.location.search.substring(1).split("&"),c=0;c<b.length;c++)if(0<b[c].indexOf("=")&&a==b[c].substring(0,b[c].indexOf("=")))return b[c].substring(b[c].indexOf("=")+1,b[c].length);return null},Base64:{_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var b="",c=0;for(a=this._utf8_encode(a);c<a.length;){var d=a.charCodeAt(c++);var e=a.charCodeAt(c++);var f=a.charCodeAt(c++);var g=d>>2;d=(d&3)<<4|e>>4;var h=(e&15)<<2|f>>6;var k=f&63;isNaN(e)?h=k=64:isNaN(f)&&(k=64);b=b+this._keyStr.charAt(g)+this._keyStr.charAt(d)+this._keyStr.charAt(h)+this._keyStr.charAt(k)}return b},decode:function(a){var b="",c=0;for(a=a.replace(/[^A-Za-z0-9\+\/=]/g,"");c<a.length;){var d=this._keyStr.indexOf(a.charAt(c++));var e=this._keyStr.indexOf(a.charAt(c++));var f=this._keyStr.indexOf(a.charAt(c++));var g=this._keyStr.indexOf(a.charAt(c++));d=d<<2|e>>4;e=(e&15)<<4|f>>2;var h=(f&3)<<6|g;b+=String.fromCharCode(d);64!=f&&(b+=String.fromCharCode(e));64!=g&&(b+=String.fromCharCode(h))}return b=this._utf8_decode(b)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):(127<d&&2048>d?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0;for(c1=c2=0;c<a.length;){var d=a.charCodeAt(c);128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3)}return b}}};
|