var __nimservice=function(k){function m(a,e,b){var d=JSON.parse(a),c={};c.messageNumber=e;c.operation=d.operation;c.callback=b;c.valid=!0;10<=C&&(C=0);u[C]=c;C+=1;f+=1;try{document.getElementById("hsmiframe").contentWindow.postMessage(a,"https://127.0.0.1:15018")}catch(r){null!=b&&b(-1)}}function t(){return"touchen"==k.ESVS.SecureKeyboardType&&k.bsUtil().isTouchEnKeyUsable()?1:"ahnlab"==k.ESVS.SecureKeyboardType&&k.bsUtil().isAhnlabProtectorUsable()?2:0}function p(a){return 0==t()?k.bsUtil().GetEnvelopedPwd(a):a}function E(a){m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:h[0],manager:"ccsign"}),f,a)}function M(a,e,b,c,d){m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:h[7],manager:"ccsign",version:a,siteInfo:e,securityInfo:b,downloadURL:c}),f,d)}function I(a,e,b,c,d,r,g){m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:h[9],manager:"ccsign",sitecode:a,modcode:e,siteURL:b,serviceIP:c,servicePort:d,downloadURL:r}),f,g)}function F(a,e,b,c){a={messageNumber:f,sessionID:""+l,operation:h[42],manager:"ccsign",pki:k.ESVS.PKI,lang:"ko_kr"==k.ESVS.Language?0:1,device:a,drive:e,pin:p(b),options:{seckeyboard:t()}};m(JSON.stringify(a),f,c)}function G(a,e){m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:h[43],manager:"ccsign",index:a,includeCertPath:1}),f,e)}function J(a,e,b,c,d,r,g,z,k,n,u){a={messageNumber:f,sessionID:""+l,operation:h[24],manager:"ccsign",index:a,pwd:p(e),input:{inputdata:{plaintype:b,hashalg:c,authattr:n?1:0,plaintext:d}},inCon:1==g?1:0,charset:r,kmcert:z,multiuse:1==k?1:0,options:{seckeyboard:t()}};m(JSON.stringify(a),f,u)}function K(a,e){e=e.split(".");a=a.split(".");len=4;for(var b=0;bx(a[b]))return!0;if(a[b]&&!e[b]&&0=a.data.length))){var e,b=null;a=JSON.parse(a.data);for(e=0;e");else c=document.createElement("img"),c.setAttribute("id","hsmImg"),c.setAttribute("src","https://127.0.0.1:15018/CRS?cd="+Math.random());c.onerror=function(){b(c,!1)};c.onload=function(){b(c,!0)};c.style.display="none";document.body.appendChild(c);if(-1!=navigator.userAgent.indexOf("MSIE 8")){var d=function(){0==v?setTimeout(d,100):b(null,!0)};setTimeout(d,100)}};0");else d=document.createElement("img"),d.setAttribute("id","hsmImg"),d.setAttribute("src","https://127.0.0.1:15018/CRS?cd="+Math.random());d.onerror=function(){b(d,!1)};d.onload=function(){b(d,!0)};d.style.display="none";document.body.appendChild(d);if(-1!=navigator.userAgent.indexOf("MSIE 8")){var f=function(){0==v?setTimeout(f,100):b(null,!0)};setTimeout(f,100)}},Init:function(a,e,b,h){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[0],domain:"unisign.co.kr",serverip:a,serverport:e,license:b}),f,h)},1)},SendReceiverInfo:function(a,e,b,h){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[1],machinetype:e,certnum:b}),f,h)},1)},ImportPFX:function(a,e){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[2]}),f,e)},1)},Finalize:function(a,e){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[3]}),f,e)},1)},Stop:function(a,e){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[4]}),f,e)},1)},GetSenderInfoMsg:function(a,e){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[5]}),f,e)},1)},GetCertNum:function(a,e,b){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[6],senderInfo:e}),f,b)},1)},GetQRCodeData:function(a,e,b){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[7],certnum:e}),f,b)},1)},AsyncWaitForReceiver:function(a,e){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[8]}),f,e)},1)},GetPassword:function(a,e){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[9]}),f,e)},1)},ExportPFX:function(a,e,b,h){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[10],pfxpwd:e,pfx:b}),f,h)},1)},AbnormalFinalize:function(a,e){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[11]}),f,e)},1)},VerifyCertNum:function(a,e,b){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[12],certnum:e}),f,b)},1)},ConnectToSmartPhone:function(a,e,b){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[13],certnum:e}),f,b)},1)},ExportPFXEx:function(a,e,b,h,k){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[14],version:e,pfx:b,pfxpwd:h}),f,k)},1)},ImportPFXEx:function(a,e,b){g(function(){d=-1;c="";m(JSON.stringify({messageNumber:f,sessionID:""+l,operation:n[15],version:e}),f,b)},1)}}};