1 |
- var __certverify=function(c){var p=function(f){function n(e,a,k){if(!e||!a)return null;var b=null;if(4<=c.ESVS.Mode&&!c.uiUtil().isItPFDevice(c.SELECTINFO.curdevice))if(c.SELECTINFO.curdevice!=c.CONST.__USFB_M_DISK.device&&c.SELECTINFO.curdevice!=c.CONST.__USFB_M_HDD.device||null==c.Whale())if(c.nimservice())c.nimservice().VerifyCertificate(e,1,function(d,e){if(0==d)b=a.IDS_VERIFY_CERT_OK;else if("MPKI"!=c.ESVS.PKI)switch(d){case 3001:b=a.IDS_VERIFY_CERT_ERROR_INVALID_TYPE;break;case 3002:b=a.IDS_VERIFY_CERT_ERROR_DECODING_FAIL;break;case 3003:b=a.IDS_VERIFY_CERT_ERROR_LOADING_FAIL;break;case 3005:b=a.IDS_VERIFY_CERT_ERROR_EXPIRED;break;case 3009:b=a.IDS_VERIFY_CERT_ERROR_NO_DP;break;case 3010:b=a.IDS_VERIFY_CERT_ERROR_WRONG_DP;break;case 3013:b=a.IDS_VERIFY_CERT_ERROR_WRONG_CRL+"<br><br>Code [ "+d+" ]";break;case 3014:b=a.IDS_VERIFY_CERT_ERROR_EXPIRED_CRL;break;case 3015:b=a.IDS_VERIFY_CERT_ERROR_WRONG_CRL+"<br><br>Code [ "+d+" ]";break;case 3016:b=a.IDS_VERIFY_CERT_ERROR_HOLDED+"<br><br>Code [ "+d+" ]";break;case 3017:b=a.IDS_VERIFY_CERT_ERROR_REVOKED+"<br><br>Code [ "+d+" ]";break;case 3059:b=a.IDS_VERIFY_CERT_ERROR_GETTING_CRL_FROM_LDAP_FAIL;break;case 3060:b=a.IDS_VERIFY_CERT_ERROR_CHECKING_ISSUER_FAIL;break;case 3062:b=a.IDS_VERIFY_CERT_ERROR_CA_CERT_PATH;break;case 3063:b=a.IDS_VERIFY_CERT_ERROR_ROOTCA_CERT_PATH;break;case 3900:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_UNSUPERSEDED;break;case 3901:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_KEYCOMPROMISE;break;case 3902:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_CACOMPROMISE;break;case 3903:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_AFFILIATIONCHANGED;break;case 3904:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_SUPERSEDED;break;case 3905:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_CESSATIONOFOPERATION;break;case 3906:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_HOLD;break;case 3907:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_REMOVEFROMCRL;break;case 3908:b=a.IDS_VERIFY_CERT_ERROR_REVOKED+"<br><br>Code [ "+d+" ]";break;case 3909:b=a.IDS_VERIFY_CERT_ERROR_REVOKED+"<br><br>Code [ "+d+" ]";break;case 3999:b=a.IDS_VERIFY_CERT_ERROR_REVOKED+"<br><br>Code [ "+d+" ]";break;default:b=a.IDS_VERIFY_CERT_ERROR_UNKNOWN+"<br><br>Code [ "+d+" ]"}else switch(d){case 3001:b=a.IDS_VERIFY_CERT_ERROR_INVALID_TYPE;break;case 3002:b=a.IDS_VERIFY_CERT_ERROR_DECODING_FAIL;break;case 3003:b=a.IDS_VERIFY_CERT_ERROR_LOADING_FAIL;break;case 3005:b=a.IDS_VERIFY_CERT_ERROR_EXPIRED;break;case 3009:b=a.IDS_VERIFY_CERT_ERROR_NO_DP;break;case 3010:b=a.IDS_VERIFY_CERT_ERROR_WRONG_DP;break;case 3013:b=a.IDS_VERIFY_CERT_ERROR_WRONG_CRL+"<br><br>Code [ "+d+" ]";break;case 3014:b=a.IDS_VERIFY_CERT_ERROR_EXPIRED_CRL;break;case 3015:b=a.IDS_VERIFY_CERT_ERROR_WRONG_CRL+"<br><br>Code [ "+d+" ]";break;case 3059:b=a.IDS_VERIFY_CERT_ERROR_GETTING_CRL_FROM_LDAP_FAIL;break;case 3060:b=a.IDS_VERIFY_CERT_ERROR_CHECKING_ISSUER_FAIL;break;case 3062:b=a.IDS_VERIFY_CERT_ERROR_CA_CERT_PATH;break;case 3063:b=a.IDS_VERIFY_CERT_ERROR_ROOTCA_CERT_PATH;break;case 3016:case 3017:case 3900:case 3901:case 3902:case 3903:case 3904:case 3905:case 3906:case 3907:case 3908:case 3909:case 3999:b=a.IDS_VERIFY_CERT_ERROR_REVOKED+"<br><br>Code [ "+d+" ]";break;case 4212E4:b=a.IDS_VERIFY_CERT_ERROR_EXPIRED+"<br>Code [ "+d+" ]";break;default:b=a.IDS_VERIFY_CERT_ERROR_UNKNOWN+"<br><br>Code [ "+d+" ]"}k(b)});else return c.uiUtil().msgBox(a.IDS_MSGBOX_NIM_ERROR_UNLOAD),b=null;else c.Whale().verifyCertitficate(e,function(d,e){if(0===d)b=a.IDS_VERIFY_CERT_OK;else if("MPKI"!=c.ESVS.PKI)switch(d){case 3001:b=a.IDS_VERIFY_CERT_ERROR_INVALID_TYPE;break;case 3002:b=a.IDS_VERIFY_CERT_ERROR_DECODING_FAIL;break;case 3003:b=a.IDS_VERIFY_CERT_ERROR_LOADING_FAIL;break;case 3005:b=a.IDS_VERIFY_CERT_ERROR_EXPIRED;break;case 3009:b=a.IDS_VERIFY_CERT_ERROR_NO_DP;break;case 3010:b=a.IDS_VERIFY_CERT_ERROR_WRONG_DP;break;case 3013:b=a.IDS_VERIFY_CERT_ERROR_WRONG_CRL+"<br><br>Code [ "+d+" ]";break;case 3014:b=a.IDS_VERIFY_CERT_ERROR_EXPIRED_CRL;break;case 3015:b=a.IDS_VERIFY_CERT_ERROR_WRONG_CRL+"<br><br>Code [ "+d+" ]";break;case 3016:b=a.IDS_VERIFY_CERT_ERROR_HOLDED+"<br><br>Code [ "+d+" ]";break;case 3017:b=a.IDS_VERIFY_CERT_ERROR_REVOKED+"<br><br>Code [ "+d+" ]";break;case 3059:b=a.IDS_VERIFY_CERT_ERROR_GETTING_CRL_FROM_LDAP_FAIL;break;case 3060:b=a.IDS_VERIFY_CERT_ERROR_CHECKING_ISSUER_FAIL;break;case 3062:b=a.IDS_VERIFY_CERT_ERROR_CA_CERT_PATH;break;case 3063:b=a.IDS_VERIFY_CERT_ERROR_ROOTCA_CERT_PATH;break;case 3900:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_UNSUPERSEDED;break;case 3901:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_KEYCOMPROMISE;break;case 3902:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_CACOMPROMISE;break;case 3903:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_AFFILIATIONCHANGED;break;case 3904:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_SUPERSEDED;break;case 3905:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_CESSATIONOFOPERATION;break;case 3906:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_HOLD;break;case 3907:b=a.IDS_VERIFY_CERT_ERROR_REVOKED_REMOVEFROMCRL;break;case 3908:b=a.IDS_VERIFY_CERT_ERROR_REVOKED+"<br><br>Code [ "+d+" ]";break;case 3909:b=a.IDS_VERIFY_CERT_ERROR_REVOKED+"<br><br>Code [ "+d+" ]";break;case 3999:b=a.IDS_VERIFY_CERT_ERROR_REVOKED+"<br><br>Code [ "+d+" ]";break;default:b=a.IDS_VERIFY_CERT_ERROR_UNKNOWN+"<br><br>Code [ "+d+" ]"}else switch(d){case 3001:b=a.IDS_VERIFY_CERT_ERROR_INVALID_TYPE;break;case 3002:b=a.IDS_VERIFY_CERT_ERROR_DECODING_FAIL;break;case 3003:b=a.IDS_VERIFY_CERT_ERROR_LOADING_FAIL;break;case 3005:b=a.IDS_VERIFY_CERT_ERROR_EXPIRED;break;case 3009:b=a.IDS_VERIFY_CERT_ERROR_NO_DP;break;case 3010:b=a.IDS_VERIFY_CERT_ERROR_WRONG_DP;break;case 3013:b=a.IDS_VERIFY_CERT_ERROR_WRONG_CRL+"<br><br>Code [ "+d+" ]";break;case 3014:b=a.IDS_VERIFY_CERT_ERROR_EXPIRED_CRL;break;case 3015:b=a.IDS_VERIFY_CERT_ERROR_WRONG_CRL+"<br><br>Code [ "+d+" ]";break;case 3059:b=a.IDS_VERIFY_CERT_ERROR_GETTING_CRL_FROM_LDAP_FAIL;break;case 3060:b=a.IDS_VERIFY_CERT_ERROR_CHECKING_ISSUER_FAIL;break;case 3062:b=a.IDS_VERIFY_CERT_ERROR_CA_CERT_PATH;break;case 3063:b=a.IDS_VERIFY_CERT_ERROR_ROOTCA_CERT_PATH;break;case 3016:case 3017:case 3900:case 3901:case 3902:case 3903:case 3904:case 3905:case 3906:case 3907:case 3908:case 3909:case 3999:b=a.IDS_VERIFY_CERT_ERROR_REVOKED+"<br><br>Code [ "+d+" ]";break;case 4212E4:b=a.IDS_VERIFY_CERT_ERROR_EXPIRED+"<br>Code [ "+d+" ]";break;default:b=a.IDS_VERIFY_CERT_ERROR_UNKNOWN+"<br><br>Code [ "+d+" ]"}k(b)});else if(2&c.ESVS.Mode)try{var g=c.usWebToolkit.pki.createCaStore(),h=c.PFSH.GetCACerts(),f;for(f in h)caCert=h[f],g.addCertificate(c.usWebToolkit.pki.certificateFromBase64(caCert));if(null==c.certsList||null==c.certsList.list||0>=c.certsList.list.length)return"";var l=c.usWebToolkit.pki.certificateFromBase64(c.certsList.list[e-1].cert);c.usWebToolkit.pki.verifyCertificateChain(g,l,function(d,g,h){if(!0===d){c.usWebToolkit.x509Certificate.parser(c.certsList.list[e-1].cert,"Base64");var f=c.usWebToolkit.x509Certificate.getcRLDistributionPoints();if(""==f)result=-1,b=IDS_VERIFY_CERT_ERROR_NO_DP;else if(d=c.usWebToolkit.x509Certificate.crlDownload(c.usWebToolkit.usWebCMP.info.CMPUrl,f),null!=d&&""!=d){g=d;if("object"==typeof d){f=f.split("?");var l="";1<f.length&&(l=f[1]);l&&(g=d[l])}!1===c.usWebToolkit.x509Certificate.verifyCRL(h[1],c.usWebToolkit.util.decode64(g)).verify?(errCode=-1,b=a.IDS_VERIFY_CERT_ERROR_REVOKED):(result=0,b=a.IDS_VERIFY_CERT_OK)}else result=3060,b=a.IDS_VERIFY_CERT_ERROR_GETTING_CRL_FROM_LDAP_FAIL}else result=-1,null!=h&&void 0!=h&&0<=h.indexOf("Certificate is not valid yet or has expired")?(errCode=3005,b=a.IDS_VERIFY_CERT_ERROR_EXPIRED):null!=h&&void 0!=h&&0<=h.indexOf("no parent issuer, so certificate not trusted")?(errCode=3060,b=a.IDS_VERIFY_CERT_ERROR_CHECKING_ISSUER_FAIL):(errCode=-1,b=h);k(b)})}catch(d){errCode=d.code,b=d.message,k(b)}}function l(c){if(!c)return alert("UI load error."),!1;var a=document.createElement("div");document.body.insertBefore(a,document.body.firstChild);a.innerHTML=c;return!0}var g=function(){var e=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");e.open("GET",c.ESVS.SRCPath+"unisignweb/rsrc/layout/certverify.html?version="+c.ver,!1);e.send(null);return e.responseText},m=function(){var e=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");e.open("GET",c.ESVS.SRCPath+"unisignweb/rsrc/lang/"+c.ESVS.Language+"/certverify_"+c.ESVS.Language+".js?version="+c.ver,!1);e.send(null);return e.responseText},h=c.ESVS.TabIndex;return function(){var e=c.CustomEval(g),a=c.CustomEval(m,!0),k=f.args.idx;l(e());e=document.getElementById("us-cert-verify-lbl-title");e.appendChild(document.createTextNode(a.IDS_VERIFY_CERT));e.setAttribute("tabindex",h,0);var b=document.getElementById("us-cert-verify-lbl");4&c.ESVS.Mode||2&c.ESVS.Mode?n(k,a,function(a){a&&b&&(b.innerHTML=a,b.setAttribute("tabindex",h+1,0))}):(k=n(k,a))&&b&&(b.innerHTML=k,b.setAttribute("tabindex",h+1,0));k=document.getElementById("us-cert-verify-confirm-btn");k.setAttribute("value",a.IDS_CONFIRM,0);k.setAttribute("title",a.IDS_CONFIRM+a.IDS_BUTTON,0);k.setAttribute("tabindex",h+2,0);k.onclick=function(){f.onConfirm()};a=document.getElementById("us-cert-verify-cls-img-btn");a.setAttribute("tabindex",h+3,0);a.onclick=function(){f.onCancel()};document.getElementById("us-cert-verify-cls-btn-img").setAttribute("src",c.ESVS.SRCPath+"unisignweb/rsrc/img/x-btn.png",0);c.uiUtil().setRotationTabFocus(k,b,e);c.uiUtil().setRotationTabFocus(e,k,b);return document.getElementById("us-div-cert-verify")}()};return function(f){var n=c.uiLayerLevel,l=c.uiUtil().getOverlay(n),g=p({type:f.type,args:f.args,onConfirm:f.onConfirm,onCancel:f.onCancel});g.style.zIndex=n+1;c.ESVS.TargetObj.insertBefore(l,c.ESVS.TargetObj.firstChild);var m=window.onresize;return{show:function(){c.ActiveUI=this;draggable(g,document.getElementById("us-div-cert-verify-title"));l.style.display="block";c.uiUtil().offsetResize(g);window.onresize=function(){c.uiUtil().offsetResize(g);m&&m()};c.uiLayerLevel+=10;c.ESVS.TabIndex+=30;setTimeout(function(){var c=g.getElementsByTagName("p");if(0<c.length)for(var e=0;e<c.length;e++)"us-cert-verify-lbl-title"==c[e].id&&c[e].focus()},10)},hide:function(){l.style.display="none";g.style.display="none"},dispose:function(){window.onresize=function(){m&&m()};g.parentNode.parentNode.removeChild(g.parentNode);l.parentNode.removeChild(l);c.uiLayerLevel-=10;c.ESVS.TabIndex-=30}}}};
|