/*! builder-forge-1.4.0.min.js - node-forge 1.4.0 subset (BSD-3-Clause, LICENSE) - BIZSOLUTION-45196 - built by Scripts/Build/forge/build.sh */ (function(){var R=function(t,e){return function(){try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}}};var D=R(function(Ba,ue){ue.exports={options:{usePureJavaScript:!1}}});var ce=R(function(Sa,le){var Dt={};le.exports=Dt;var he={};Dt.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var i="";if(!(t instanceof Uint8Array))i=fr(t,e);else{var a=0,n=e.length,s=e.charAt(0),o=[0];for(a=0;a0;)o.push(f%n),f=f/n|0}for(a=0;t[a]===0&&a=0;--a)i+=e[o[a]]}if(r){var h=new RegExp(".{1,"+r+"}","g");i=i.match(h).join("\r\n")}return i};Dt.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=he[e];if(!r){r=he[e]=[];for(var i=0;i>=8;for(;f>0;)s.push(f&255),f>>=8}for(var h=0;t[h]===n&&h0;)n.push(o%i),o=o/i|0}var u="";for(r=0;t.at(r)===0&&r=0;--r)u+=e[n[r]];return u}});var O=R(function(Ca,ve){var pe=D(),de=ce(),c=ve.exports=pe.util=pe.util||{};(function(){if(typeof process!="undefined"&&process.nextTick&&!process.browser){c.nextTick=process.nextTick,typeof setImmediate=="function"?c.setImmediate=setImmediate:c.setImmediate=c.nextTick;return}if(typeof setImmediate=="function"){c.setImmediate=function(){return setImmediate.apply(void 0,arguments)},c.nextTick=function(o){return setImmediate(o)};return}if(c.setImmediate=function(o){setTimeout(o,0)},typeof window!="undefined"&&typeof window.postMessage=="function"){var o=function(u){if(u.source===window&&u.data===t){u.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(h){h()})}},s=o,t="forge.setImmediate",e=[];c.setImmediate=function(u){e.push(u),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver!="undefined"){var r=Date.now(),i=!0,a=document.createElement("div"),e=[];new MutationObserver(function(){var u=e.slice();e.length=0,u.forEach(function(f){f()})}).observe(a,{attributes:!0});var n=c.setImmediate;c.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),n(u)):(e.push(u),e.length===1&&a.setAttribute("a",i=!i))}}c.nextTick=c.setImmediate})();c.isNodejs=typeof process!="undefined"&&process.versions&&process.versions.node;c.globalScope=(function(){return c.isNodejs?global:typeof self=="undefined"?window:self})();c.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};c.isArrayBuffer=function(t){return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer};c.isArrayBufferView=function(t){return t&&c.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function ct(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}c.ByteBuffer=kt;function kt(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(c.isArrayBuffer(t)||c.isArrayBufferView(t))if(typeof Buffer!="undefined"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(i){for(var r=0;rur&&(this.data.substr(0,1),this._constructedStringLength=0)};c.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};c.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};c.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};c.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};c.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};c.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(c.encodeUtf8(t))};c.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};c.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};c.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};c.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};c.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};c.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};c.ByteStringBuffer.prototype.putInt=function(t,e){ct(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};c.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};c.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};c.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};c.ByteStringBuffer.prototype.bytes=function(t){return typeof t=="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};c.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};c.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};c.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};c.ByteStringBuffer.prototype.copy=function(){var t=c.createBuffer(this.data);return t.read=this.read,t};c.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};c.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};c.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};c.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),i=new Uint8Array(this.length()+e);return i.set(r),this.data=new DataView(i.buffer),this};c.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};c.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};c.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};c.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};c.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};c.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};c.DataBuffer.prototype.putInt=function(t,e){ct(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};c.DataBuffer.prototype.putSignedInt=function(t,e){return ct(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};c.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};c.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};c.DataBuffer.prototype.bytes=function(t){return typeof t=="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};c.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};c.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};c.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};c.DataBuffer.prototype.copy=function(){return new c.DataBuffer(this)};c.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};c.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};c.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};c.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};c.xorBytes=function(t,e,r){for(var i="",a="",n="",s=0,o=0;r>0;--r,++s)a=t.charCodeAt(s)^e.charCodeAt(s),o>=10&&(i+=n,n="",o=0),n+=String.fromCharCode(a),++o;return i+=n,i};c.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",et=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],ge="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";c.encode64=function(t,e){for(var r="",i="",a,n,s,o=0;o>2),r+=tt.charAt((a&3)<<4|n>>4),isNaN(n)?r+="==":(r+=tt.charAt((n&15)<<2|s>>6),r+=isNaN(s)?"=":tt.charAt(s&63)),e&&r.length>e&&(i+=r.substr(0,e)+"\r\n",r=r.substr(e));return i+=r,i};c.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,i,a,n,s=0;s>4),a!==64&&(e+=String.fromCharCode((i&15)<<4|a>>2),n!==64&&(e+=String.fromCharCode((a&3)<<6|n)));return e};c.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};c.decodeUtf8=function(t){return decodeURIComponent(escape(t))};c.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:de.encode,decode:de.decode}};c.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};c.binary.raw.decode=function(t,e,r){var i=e;i||(i=new Uint8Array(t.length)),r=r||0;for(var a=r,n=0;n>2),r+=tt.charAt((a&3)<<4|n>>4),isNaN(n)?r+="==":(r+=tt.charAt((n&15)<<2|s>>6),r+=isNaN(s)?"=":tt.charAt(s&63)),e&&r.length>e&&(i+=r.substr(0,e)+"\r\n",r=r.substr(e));return i+=r,i};c.binary.base64.decode=function(t,e,r){var i=e;i||(i=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var a,n,s,o,u=0,f=r;u>4,s!==64&&(i[f++]=(n&15)<<4|s>>2,o!==64&&(i[f++]=(s&3)<<6|o));return e?f-r:i.subarray(0,f)};c.binary.base58.encode=function(t,e){return c.binary.baseN.encode(t,ge,e)};c.binary.base58.decode=function(t,e){return c.binary.baseN.decode(t,ge,e)};c.text={utf8:{},utf16:{}};c.text.utf8.encode=function(t,e,r){t=c.encodeUtf8(t);var i=e;i||(i=new Uint8Array(t.length)),r=r||0;for(var a=r,n=0;n0&&n.push(i),s=e.lastIndex;var o=r[0][1];switch(o){case"s":case"o":a");break;case"%":n.push("%");break;default:n.push("<\x25"+o+"?>")}}return n.push(t.substring(s)),n.join("")};c.formatNumber=function(t,e,r,i){var a=t,n=isNaN(e=Math.abs(e))?2:e,s=r===void 0?",":r,o=i===void 0?".":i,u=a<0?"-":"",f=parseInt(a=Math.abs(+a||0).toFixed(n),10)+"",h=f.length>3?f.length%3:0;return u+(h?f.substr(0,h)+o:"")+f.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+o)+(n?s+Math.abs(a-f).toFixed(n).slice(2):"")};c.formatSize=function(t){return t>=1073741824?t=c.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=c.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=c.formatNumber(t/1024,0)+" KiB":t=c.formatNumber(t,0)+" bytes",t};c.bytesFromIP=function(t){return t.indexOf(".")!==-1?c.bytesFromIPv4(t):t.indexOf(":")!==-1?c.bytesFromIPv6(t):null};c.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=c.createBuffer(),r=0;rr[i].end-r[i].start&&(i=r.length-1))}e.push(n)}if(r.length>0){var u=r[i];u.end-u.start>0&&(e.splice(u.start,u.end-u.start+1,""),u.start===0&&e.unshift(""),u.end===7&&e.push(""))}return e.join(":")};c.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in c&&!t.update)return e(null,c.cores);if(typeof navigator!="undefined"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return c.cores=navigator.hardwareConcurrency,e(null,c.cores);if(typeof Worker=="undefined")return c.cores=1,e(null,c.cores);if(typeof Blob=="undefined")return c.cores=2,e(null,c.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(s){for(var o=Date.now(),u=o+4;Date.now()m.st&&h.sth.st&&m.st>>0,s>>>0];for(var o=i.fullMessageLength.length-1;o>=0;--o)i.fullMessageLength[o]+=s[1],s[1]=s[0]+(i.fullMessageLength[o]/4294967296>>>0),i.fullMessageLength[o]=i.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(a),me(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),i},i.digest=function(){var a=Q.util.createBuffer();a.putBytes(e.bytes());var n=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize,s=n&i.blockLength-1;a.putBytes(Ut.substr(0,i.blockLength-s));for(var o,u,f=i.fullMessageLength[0]*8,h=0;h>>0,f+=u,a.putInt32(f>>>0),f=o>>>0;a.putInt32(f);var l={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};me(l,r,a);var d=Q.util.createBuffer();return d.putInt32(l.h0),d.putInt32(l.h1),d.putInt32(l.h2),d.putInt32(l.h3),d.putInt32(l.h4),d},i};var Ut=null,Se=!1;function gr(){Ut="\x80",Ut+=Q.util.fillString("\0",64),Se=!0}function me(t,e,r){for(var i,a,n,s,o,u,f,h,l=r.length();l>=64;){for(a=t.h0,n=t.h1,s=t.h2,o=t.h3,u=t.h4,h=0;h<16;++h)i=r.getInt32(),e[h]=i,f=o^n&(s^o),i=(a<<5|a>>>27)+f+u+1518500249+i,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=i;for(;h<20;++h)i=e[h-3]^e[h-8]^e[h-14]^e[h-16],i=i<<1|i>>>31,e[h]=i,f=o^n&(s^o),i=(a<<5|a>>>27)+f+u+1518500249+i,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=i;for(;h<32;++h)i=e[h-3]^e[h-8]^e[h-14]^e[h-16],i=i<<1|i>>>31,e[h]=i,f=n^s^o,i=(a<<5|a>>>27)+f+u+1859775393+i,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=i;for(;h<40;++h)i=e[h-6]^e[h-16]^e[h-28]^e[h-32],i=i<<2|i>>>30,e[h]=i,f=n^s^o,i=(a<<5|a>>>27)+f+u+1859775393+i,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=i;for(;h<60;++h)i=e[h-6]^e[h-16]^e[h-28]^e[h-32],i=i<<2|i>>>30,e[h]=i,f=n&s|o&(n^s),i=(a<<5|a>>>27)+f+u+2400959708+i,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=i;for(;h<80;++h)i=e[h-6]^e[h-16]^e[h-28]^e[h-32],i=i<<2|i>>>30,e[h]=i,f=n^s^o,i=(a<<5|a>>>27)+f+u+3395469782+i,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=i;t.h0=t.h0+a|0,t.h1=t.h1+n|0,t.h2=t.h2+s|0,t.h3=t.h3+o|0,t.h4=t.h4+u|0,l-=64}}});var Kt=R(function(Aa,be){var Z=D();pt();O();var Ee=be.exports=Z.sha256=Z.sha256||{};Z.md.sha256=Z.md.algorithms.sha256=Ee;Ee.create=function(){Ae||vr();var t=null,e=Z.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return i.start=function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var a=i.messageLengthSize/4,n=0;n>>0,s>>>0];for(var o=i.fullMessageLength.length-1;o>=0;--o)i.fullMessageLength[o]+=s[1],s[1]=s[0]+(i.fullMessageLength[o]/4294967296>>>0),i.fullMessageLength[o]=i.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(a),Te(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),i},i.digest=function(){var a=Z.util.createBuffer();a.putBytes(e.bytes());var n=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize,s=n&i.blockLength-1;a.putBytes(Ot.substr(0,i.blockLength-s));for(var o,u,f=i.fullMessageLength[0]*8,h=0;h>>0,f+=u,a.putInt32(f>>>0),f=o>>>0;a.putInt32(f);var l={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};Te(l,r,a);var d=Z.util.createBuffer();return d.putInt32(l.h0),d.putInt32(l.h1),d.putInt32(l.h2),d.putInt32(l.h3),d.putInt32(l.h4),d.putInt32(l.h5),d.putInt32(l.h6),d.putInt32(l.h7),d},i};var Ot=null,Ae=!1,Ie=null;function vr(){Ot="\x80",Ot+=Z.util.fillString("\0",64),Ie=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ae=!0}function Te(t,e,r){for(var i,a,n,s,o,u,f,h,l,d,m,y,S,C,E,I=r.length();I>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)i=e[f-2],i=(i>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,a=e[f-15],a=(a>>>7|a<<25)^(a>>>18|a<<14)^a>>>3,e[f]=i+e[f-7]+a+e[f-16]|0;for(h=t.h0,l=t.h1,d=t.h2,m=t.h3,y=t.h4,S=t.h5,C=t.h6,E=t.h7,f=0;f<64;++f)s=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),o=C^y&(S^C),n=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),u=h&l|d&(h^l),i=E+s+o+Ie[f]+e[f],a=n+u,E=C,C=S,S=y,y=m+i>>>0,m=d,d=l,l=h,h=i+a>>>0;t.h0=t.h0+h|0,t.h1=t.h1+l|0,t.h2=t.h2+d|0,t.h3=t.h3+m|0,t.h4=t.h4+y|0,t.h5=t.h5+S|0,t.h6=t.h6+C|0,t.h7=t.h7+E|0,I-=64}}});var _e=R(function(Ia,we){var $=D();pt();O();var yr=we.exports=$.hmac=$.hmac||{};yr.create=function(){var t=null,e=null,r=null,i=null,a={};return a.start=function(n,s){if(n!==null)if(typeof n=="string")if(n=n.toLowerCase(),n in $.md.algorithms)e=$.md.algorithms[n].create();else throw new Error('Unknown hash algorithm "'+n+'"');else e=n;if(s===null)s=t;else{if(typeof s=="string")s=$.util.createBuffer(s);else if($.util.isArray(s)){var o=s;s=$.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(s.bytes()),s=e.digest()),r=$.util.createBuffer(),i=$.util.createBuffer(),f=s.length();for(var u=0;u0))return!0;for(var i=0;i0))return!0;for(var i=0;i0)return!1;var r=t.length(),i=t.at(r-1);return i>this.blockSize<<2?!1:(t.truncate(i),!0)};b.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};b.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=St(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};b.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var i=0;i0))return!0;for(var i=0;i0)return!1;var r=t.length(),i=t.at(r-1);return i>this.blockSize<<2?!1:(t.truncate(i),!0)};b.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=F.util.createBuffer(),this._partialBytes=0};b.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=St(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};b.cfb.prototype.encrypt=function(t,e,r){var i=t.length();if(i===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&i>=this.blockSize){for(var a=0;a0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a0)t.read-=this.blockSize;else for(var a=0;a0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0};b.cfb.prototype.decrypt=function(t,e,r){var i=t.length();if(i===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&i>=this.blockSize){for(var a=0;a0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a0)t.read-=this.blockSize;else for(var a=0;a0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0};b.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=F.util.createBuffer(),this._partialBytes=0};b.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=St(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};b.ofb.prototype.encrypt=function(t,e,r){var i=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&i>=this.blockSize){for(var a=0;a0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a0)t.read-=this.blockSize;else for(var a=0;a0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0};b.ofb.prototype.decrypt=b.ofb.prototype.encrypt;b.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=F.util.createBuffer(),this._partialBytes=0};b.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=St(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};b.ctr.prototype.encrypt=function(t,e,r){var i=t.length();if(i===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&i>=this.blockSize)for(var a=0;a0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}Ct(this._inBlock)};b.ctr.prototype.decrypt=b.ctr.prototype.encrypt;b.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=F.util.createBuffer(),this._partialBytes=0,this._R=3774873600};b.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=F.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=F.util.createBuffer(t.additionalData):r=F.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=F.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=e.length();if(i===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(zt(i*8)))}this._inBlock=this._j0.slice(0),Ct(this._inBlock),this._partialBytes=0,r=F.util.createBuffer(r),this._aDataLength=zt(r.length()*8);var a=r.length()%this.blockSize;for(a&&r.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};b.gcm.prototype.encrypt=function(t,e,r){var i=t.length();if(i===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&i>=this.blockSize){for(var a=0;a0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Ct(this._inBlock)};b.gcm.prototype.decrypt=function(t,e,r){var i=t.length();if(i0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Ct(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var a=0;a0;--i)e[i]=t[i]>>>1|(t[i-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};b.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var i=r/8|0,a=t[i]>>>(7-r%8)*4&15,n=this._m[r][a];e[0]^=n[0],e[1]^=n[1],e[2]^=n[2],e[3]^=n[3]}return e};b.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};b.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,i=4*r,a=16*r,n=new Array(a),s=0;s>>1,a=new Array(r);a[i]=t.slice(0);for(var n=i>>>1;n>0;)this.pow(a[2*n],a[n]=[]),n>>=1;for(n=2;n4){var r=t;t=F.util.createBuffer();for(var i=0;i>>2;for(var i=0;i>8^o&255^99,K[r]=o,Ht[o]=r,u=t[o],a=t[r],n=t[a],s=t[n],f=u<<24^o<<16^o<<8^(o^u),h=(a^n^s)<<24^(r^s)<<16^(r^n^s)<<8^(r^a^s);for(var l=0;l<4;++l)at[l][r]=f,H[l][o]=h,f=f<<24|f>>>8,h=h<<24|h>>>8;r===0?r=i=1:(r=a^t[t[t[a^s]]],i^=t[t[i]])}}function De(t,e){for(var r=t.slice(0),i,a=1,n=r.length,s=n+6+1,o=ft*s,u=n;u>>16&255]<<24^K[i>>>8&255]<<16^K[i&255]<<8^K[i>>>24]^Ne[a]<<24,a++):n>6&&u%n===4&&(i=K[i>>>24]<<24^K[i>>>16&255]<<16^K[i>>>8&255]<<8^K[i&255]),r[u]=r[u-n]^i;if(e){var f,h=H[0],l=H[1],d=H[2],m=H[3],y=r.slice(0);o=r.length;for(var u=0,S=o-ft;u>>24]]^l[K[f>>>16&255]]^d[K[f>>>8&255]]^m[K[f&255]];r=y}return r}function Wt(t,e,r,i){var a=t.length/4-1,n,s,o,u,f;i?(n=H[0],s=H[1],o=H[2],u=H[3],f=Ht):(n=at[0],s=at[1],o=at[2],u=at[3],f=K);var h,l,d,m,y,S,C;h=e[0]^t[0],l=e[i?3:1]^t[1],d=e[2]^t[2],m=e[i?1:3]^t[3];for(var E=3,I=1;I>>24]^s[l>>>16&255]^o[d>>>8&255]^u[m&255]^t[++E],S=n[l>>>24]^s[d>>>16&255]^o[m>>>8&255]^u[h&255]^t[++E],C=n[d>>>24]^s[m>>>16&255]^o[h>>>8&255]^u[l&255]^t[++E],m=n[m>>>24]^s[h>>>16&255]^o[l>>>8&255]^u[d&255]^t[++E],h=y,l=S,d=C;r[0]=f[h>>>24]<<24^f[l>>>16&255]<<16^f[d>>>8&255]<<8^f[m&255]^t[++E],r[i?3:1]=f[l>>>24]<<24^f[d>>>16&255]<<16^f[m>>>8&255]<<8^f[h&255]^t[++E],r[2]=f[d>>>24]<<24^f[m>>>16&255]<<16^f[h>>>8&255]<<8^f[l&255]^t[++E],r[i?1:3]=f[m>>>24]<<24^f[h>>>16&255]<<16^f[l>>>8&255]<<8^f[d&255]^t[++E]}function Tt(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,i;t.decrypt?i=L.cipher.createDecipher(r,t.key):i=L.cipher.createCipher(r,t.key);var a=i.start;return i.start=function(n,s){var o=null;s instanceof L.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=n,a.call(i,s)},i}});var Yt=R(function(){});var Pe=R(function(Na,Fe){var Y=D();O();var Et=null;Y.util.isNodejs&&!Y.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Et=Yt());var mr=Fe.exports=Y.prng=Y.prng||{};mr.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,i=new Array(32),a=0;a<32;++a)i[a]=r.create();e.pools=i,e.pool=0,e.generate=function(f,h){if(!h)return e.generateSync(f);var l=e.plugin.cipher,d=e.plugin.increment,m=e.plugin.formatKey,y=e.plugin.formatSeed,S=Y.util.createBuffer();e.key=null,C();function C(E){if(E)return h(E);if(S.length()>=f)return h(null,S.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return Y.util.nextTick(function(){n(C)});var I=l(e.key,e.seed);e.generated+=I.length,S.putBytes(I),e.key=m(l(e.key,d(e.seed))),e.seed=y(l(e.key,e.seed)),Y.util.setImmediate(C)}},e.generateSync=function(f){var h=e.plugin.cipher,l=e.plugin.increment,d=e.plugin.formatKey,m=e.plugin.formatSeed;e.key=null;for(var y=Y.util.createBuffer();y.length()1048575&&(e.key=null),e.key===null&&s();var S=h(e.key,e.seed);e.generated+=S.length,y.putBytes(S),e.key=d(h(e.key,l(e.seed))),e.seed=m(h(e.key,e.seed))}return y.getBytes(f)};function n(f){if(e.pools[0].messageLength>=32)return o(),f();var h=32-e.pools[0].messageLength<<5;e.seedFile(h,function(l,d){if(l)return f(l);e.collect(d),o(),f()})}function s(){if(e.pools[0].messageLength>=32)return o();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),o()}function o(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var h=1,l=0;l<32;++l)e.reseeds%h===0&&(f.update(e.pools[l].digest().getBytes()),e.pools[l].start()),h=h<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var d=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(d),e.generated=0}function u(f){var h=null,l=Y.util.globalScope,d=l.crypto||l.msCrypto;d&&d.getRandomValues&&(h=function(M){return d.getRandomValues(M)});var m=Y.util.createBuffer();if(h)for(;m.length()>16),I+=(E&32767)<<16,I+=E>>15,I=(I&2147483647)+(I>>31),q=I&4294967295;for(var C=0;C<3;++C)U=q>>>(C<<3),U^=Math.floor(Math.random()*256),m.putByte(U&255)}return m.getBytes(f)}return Et?(e.seedFile=function(f,h){Et.randomBytes(f,function(l,d){if(l)return h(l);h(null,d.toString())})},e.seedFileSync=function(f){return Et.randomBytes(f).toString()}):(e.seedFile=function(f,h){try{h(null,u(f))}catch(l){h(l)}},e.seedFileSync=u),e.collect=function(f){for(var h=f.length,l=0;l>d&255);e.collect(l)},e.registerWorker=function(f){if(f===self)e.seedFile=function(l,d){function m(y){var S=y.data;S.forge&&S.forge.prng&&(self.removeEventListener("message",m),d(S.forge.prng.err,S.forge.prng.bytes))}self.addEventListener("message",m),self.postMessage({forge:{prng:{needed:l}}})};else{var h=function(l){var d=l.data;d.forge&&d.forge.prng&&e.seedFile(d.forge.prng.needed,function(m,y){f.postMessage({forge:{prng:{err:m,bytes:y}}})})};f.addEventListener("message",h)}},e}});var dt=R(function(Ra,Jt){var P=D();Zt();Kt();Pe();O();(function(){if(P.random&&P.random.getBytes){Jt.exports=P.random;return}(function(t){var e={},r=new Array(4),i=P.util.createBuffer();e.formatKey=function(l){var d=P.util.createBuffer(l);return l=new Array(4),l[0]=d.getInt32(),l[1]=d.getInt32(),l[2]=d.getInt32(),l[3]=d.getInt32(),P.aes._expandKey(l,!1)},e.formatSeed=function(l){var d=P.util.createBuffer(l);return l=new Array(4),l[0]=d.getInt32(),l[1]=d.getInt32(),l[2]=d.getInt32(),l[3]=d.getInt32(),l},e.cipher=function(l,d){return P.aes._updateBlock(l,d,r,!1),i.putInt32(r[0]),i.putInt32(r[1]),i.putInt32(r[2]),i.putInt32(r[3]),i.getBytes()},e.increment=function(l){return++l[3],l},e.md=P.md.sha256;function a(){var l=P.prng.create(e);return l.getBytes=function(d,m){return l.generate(d,m)},l.getBytesSync=function(d){return l.generate(d)},l}var n=a(),s=null,o=P.util.globalScope,u=o.crypto||o.msCrypto;if(u&&u.getRandomValues&&(s=function(l){return u.getRandomValues(l)}),P.options.usePureJavaScript||!P.util.isNodejs&&!s){if(typeof window=="undefined"||window.document,n.collectInt(+new Date,32),typeof navigator!="undefined"){var f="";for(var h in navigator)try{typeof navigator[h]=="string"&&(f+=navigator[h])}catch(l){}n.collect(f),f=null}t&&(t().mousemove(function(l){n.collectInt(l.clientX,16),n.collectInt(l.clientY,16)}),t().keypress(function(l){n.collectInt(l.charCode,8)}))}if(!P.random)P.random=n;else for(var h in n)P.random[h]=n[h];P.random.createInstance=a,Jt.exports=P.random})(typeof jQuery!="undefined"?jQuery:null)})()});var Me=R(function(Da,Ue){var nt=D();O();nt.mgf=nt.mgf||{};var Br=Ue.exports=nt.mgf.mgf1=nt.mgf1=nt.mgf1||{};Br.create=function(t){var e={generate:function(r,i){for(var a=new nt.util.ByteBuffer,n=Math.ceil(i/t.digestLength),s=0;su){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=u,f}i||(i=""),n.update(i,"raw");for(var h=n.digest(),l="",d=u-e.length,m=0;m>24&255,n>>16&255,n>>8&255,n&255);r.start(),r.update(t+s),i+=r.digest().getBytes()}return i.substring(0,e)}});var It=R(function(Fa,qe){var gt=D();gt.pki=gt.pki||{};var $t=qe.exports=gt.pki.oids=gt.oids=gt.oids||{};function v(t,e){$t[t]=e,$t[e]=t}function x(t,e){$t[t]=e}v("1.2.840.113549.1.1.1","rsaEncryption");v("1.2.840.113549.1.1.4","md5WithRSAEncryption");v("1.2.840.113549.1.1.5","sha1WithRSAEncryption");v("1.2.840.113549.1.1.7","RSAES-OAEP");v("1.2.840.113549.1.1.8","mgf1");v("1.2.840.113549.1.1.9","pSpecified");v("1.2.840.113549.1.1.10","RSASSA-PSS");v("1.2.840.113549.1.1.11","sha256WithRSAEncryption");v("1.2.840.113549.1.1.12","sha384WithRSAEncryption");v("1.2.840.113549.1.1.13","sha512WithRSAEncryption");v("1.3.101.112","EdDSA25519");v("1.2.840.10040.4.3","dsa-with-sha1");v("1.3.14.3.2.7","desCBC");v("1.3.14.3.2.26","sha1");v("1.3.14.3.2.29","sha1WithRSASignature");v("2.16.840.1.101.3.4.2.1","sha256");v("2.16.840.1.101.3.4.2.2","sha384");v("2.16.840.1.101.3.4.2.3","sha512");v("2.16.840.1.101.3.4.2.4","sha224");v("2.16.840.1.101.3.4.2.5","sha512-224");v("2.16.840.1.101.3.4.2.6","sha512-256");v("1.2.840.113549.2.2","md2");v("1.2.840.113549.2.5","md5");v("1.2.840.113549.1.7.1","data");v("1.2.840.113549.1.7.2","signedData");v("1.2.840.113549.1.7.3","envelopedData");v("1.2.840.113549.1.7.4","signedAndEnvelopedData");v("1.2.840.113549.1.7.5","digestedData");v("1.2.840.113549.1.7.6","encryptedData");v("1.2.840.113549.1.9.1","emailAddress");v("1.2.840.113549.1.9.2","unstructuredName");v("1.2.840.113549.1.9.3","contentType");v("1.2.840.113549.1.9.4","messageDigest");v("1.2.840.113549.1.9.5","signingTime");v("1.2.840.113549.1.9.6","counterSignature");v("1.2.840.113549.1.9.7","challengePassword");v("1.2.840.113549.1.9.8","unstructuredAddress");v("1.2.840.113549.1.9.14","extensionRequest");v("1.2.840.113549.1.9.20","friendlyName");v("1.2.840.113549.1.9.21","localKeyId");v("1.2.840.113549.1.9.22.1","x509Certificate");v("1.2.840.113549.1.12.10.1.1","keyBag");v("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");v("1.2.840.113549.1.12.10.1.3","certBag");v("1.2.840.113549.1.12.10.1.4","crlBag");v("1.2.840.113549.1.12.10.1.5","secretBag");v("1.2.840.113549.1.12.10.1.6","safeContentsBag");v("1.2.840.113549.1.5.13","pkcs5PBES2");v("1.2.840.113549.1.5.12","pkcs5PBKDF2");v("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");v("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");v("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");v("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");v("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");v("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");v("1.2.840.113549.2.7","hmacWithSHA1");v("1.2.840.113549.2.8","hmacWithSHA224");v("1.2.840.113549.2.9","hmacWithSHA256");v("1.2.840.113549.2.10","hmacWithSHA384");v("1.2.840.113549.2.11","hmacWithSHA512");v("1.2.840.113549.3.7","des-EDE3-CBC");v("2.16.840.1.101.3.4.1.2","aes128-CBC");v("2.16.840.1.101.3.4.1.22","aes192-CBC");v("2.16.840.1.101.3.4.1.42","aes256-CBC");v("2.5.4.3","commonName");v("2.5.4.4","surname");v("2.5.4.5","serialNumber");v("2.5.4.6","countryName");v("2.5.4.7","localityName");v("2.5.4.8","stateOrProvinceName");v("2.5.4.9","streetAddress");v("2.5.4.10","organizationName");v("2.5.4.11","organizationalUnitName");v("2.5.4.12","title");v("2.5.4.13","description");v("2.5.4.15","businessCategory");v("2.5.4.17","postalCode");v("2.5.4.42","givenName");v("2.5.4.65","pseudonym");v("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");v("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");v("2.16.840.1.113730.1.1","nsCertType");v("2.16.840.1.113730.1.13","nsComment");x("2.5.29.1","authorityKeyIdentifier");x("2.5.29.2","keyAttributes");x("2.5.29.3","certificatePolicies");x("2.5.29.4","keyUsageRestriction");x("2.5.29.5","policyMapping");x("2.5.29.6","subtreesConstraint");x("2.5.29.7","subjectAltName");x("2.5.29.8","issuerAltName");x("2.5.29.9","subjectDirectoryAttributes");x("2.5.29.10","basicConstraints");x("2.5.29.11","nameConstraints");x("2.5.29.12","policyConstraints");x("2.5.29.13","basicConstraints");v("2.5.29.14","subjectKeyIdentifier");v("2.5.29.15","keyUsage");x("2.5.29.16","privateKeyUsagePeriod");v("2.5.29.17","subjectAltName");v("2.5.29.18","issuerAltName");v("2.5.29.19","basicConstraints");x("2.5.29.20","cRLNumber");x("2.5.29.21","cRLReason");x("2.5.29.22","expirationDate");x("2.5.29.23","instructionCode");x("2.5.29.24","invalidityDate");x("2.5.29.25","cRLDistributionPoints");x("2.5.29.26","issuingDistributionPoint");x("2.5.29.27","deltaCRLIndicator");x("2.5.29.28","issuingDistributionPoint");x("2.5.29.29","certificateIssuer");x("2.5.29.30","nameConstraints");v("2.5.29.31","cRLDistributionPoints");v("2.5.29.32","certificatePolicies");x("2.5.29.33","policyMappings");x("2.5.29.34","policyConstraints");v("2.5.29.35","authorityKeyIdentifier");x("2.5.29.36","policyConstraints");v("2.5.29.37","extKeyUsage");x("2.5.29.46","freshestCRL");x("2.5.29.54","inhibitAnyPolicy");v("1.3.6.1.4.1.11129.2.4.2","timestampList");v("1.3.6.1.5.5.7.1.1","authorityInfoAccess");v("1.3.6.1.5.5.7.3.1","serverAuth");v("1.3.6.1.5.5.7.3.2","clientAuth");v("1.3.6.1.5.5.7.3.3","codeSigning");v("1.3.6.1.5.5.7.3.4","emailProtection");v("1.3.6.1.5.5.7.3.8","timeStamping")});var jt=R(function(Pa,ze){var N=D();O();It();var B=ze.exports=N.asn1=N.asn1||{};B.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};B.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};B.maxDepth=256;B.create=function(t,e,r,i,a){if(N.util.isArray(i)){for(var n=[],s=0;se){var i=new Error("Too few bytes to parse DER.");throw i.available=t.length(),i.remaining=e,i.requested=r,i}}var Sr=function(t,e){var r=t.getByte();if(e--,r!==128){var i,a=r&128;if(!a)i=r;else{var n=r&127;vt(t,e,n),i=t.getInt(n<<3)}if(i<0)throw new Error("Negative length: "+i);return i}};B.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"maxDepth"in e||(e.maxDepth=B.maxDepth),typeof t=="string"&&(t=N.util.createBuffer(t));var r=t.length(),i=bt(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var a=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw a.byteCount=r,a.remaining=t.length(),a}return i};function bt(t,e,r,i){if(r>=i.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var a;vt(t,e,2);var n=t.getByte();e--;var s=n&192,o=n&31;a=t.length();var u=Sr(t,e);if(e-=a-t.length(),u!==void 0&&u>e){if(i.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=t.length(),f.remaining=e,f.requested=u,f}u=e}var h,l,d=(n&32)===32;if(d)if(h=[],u===void 0)for(;;){if(vt(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}a=t.length(),h.push(bt(t,e,r+1,i)),e-=a-t.length()}else for(;u>0;)a=t.length(),h.push(bt(t,u,r+1,i)),e-=a-t.length(),u-=a-t.length();if(h===void 0&&s===B.Class.UNIVERSAL&&o===B.Type.BITSTRING&&(l=t.bytes(u)),h===void 0&&i.decodeBitStrings&&s===B.Class.UNIVERSAL&&o===B.Type.BITSTRING&&u>1){var m=t.read,y=e,S=0;if(o===B.Type.BITSTRING&&(vt(t,e,1),S=t.getByte(),e--),S===0)try{a=t.length();var C={strict:!0,decodeBitStrings:!0},E=bt(t,e,r+1,C),I=a-t.length();e-=I,o==B.Type.BITSTRING&&I++;var U=E.tagClass;I===u&&(U===B.Class.UNIVERSAL||U===B.Class.CONTEXT_SPECIFIC)&&(h=[E])}catch(M){}h===void 0&&(t.read=m,e=y)}if(h===void 0){if(u===void 0){if(i.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=e}if(o===B.Type.BMPSTRING)for(h="";u>0;u-=2)vt(t,e,2),h+=String.fromCharCode(t.getInt16()),e-=2;else h=t.getBytes(u),e-=u}var q=l===void 0?null:{bitStringContents:l};return B.create(s,o,d,h,q)}B.toDer=function(t){var e=N.util.createBuffer(),r=t.tagClass|t.type,i=N.util.createBuffer(),a=!1;if("bitStringContents"in t&&(a=!0,t.original&&(a=B.equals(t,t.original))),a)i.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:i.putByte(0);for(var n=0;n1&&(t.value.charCodeAt(0)===0&&(t.value.charCodeAt(1)&128)===0||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?i.putBytes(t.value.substr(1)):i.putBytes(t.value);if(e.putByte(r),i.length()<=127)e.putByte(i.length()&127);else{var s=i.length(),o="";do o+=String.fromCharCode(s&255),s=s>>>8;while(s>0);e.putByte(o.length|128);for(var n=o.length-1;n>=0;--n)e.putByte(o.charCodeAt(n))}return e.putBuffer(i),e};B.oidToDer=function(t){var e=t.split("."),r=N.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var i,a,n,s,o=2;o4294967295)throw new Error("OID value too large; max is 32-bits.");do s=n&127,n=n>>>7,i||(s|=128),a.push(s),i=!1;while(n>0);for(var u=a.length-1;u>=0;--u)r.putByte(a[u])}return r};B.derToOid=function(t){var e;typeof t=="string"&&(t=N.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var i=0;t.length()>0;){if(i>70368744177663)throw new Error("OID value too large; max is 53-bits.");r=t.getByte(),i=i*128,r&128?i+=r&127:(e+="."+(i+r),i=0)}return e};B.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var i=parseInt(t.substr(2,2),10)-1,a=parseInt(t.substr(4,2),10),n=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=0;if(t.length>11){var u=t.charAt(10),f=10;u!=="+"&&u!=="-"&&(o=parseInt(t.substr(10,2),10),f+=2)}if(e.setUTCFullYear(r,i,a),e.setUTCHours(n,s,o,0),f&&(u=t.charAt(f),u==="+"||u==="-")){var h=parseInt(t.substr(f+1,2),10),l=parseInt(t.substr(f+4,2),10),d=h*60+l;d*=6e4,u==="+"?e.setTime(+e-d):e.setTime(+e+d)}return e};B.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),i=parseInt(t.substr(4,2),10)-1,a=parseInt(t.substr(6,2),10),n=parseInt(t.substr(8,2),10),s=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),u=0,f=0,h=!1;t.charAt(t.length-1)==="Z"&&(h=!0);var l=t.length-5,d=t.charAt(l);if(d==="+"||d==="-"){var m=parseInt(t.substr(l+1,2),10),y=parseInt(t.substr(l+4,2),10);f=m*60+y,f*=6e4,d==="+"&&(f*=-1),h=!0}return t.charAt(14)==="."&&(u=parseFloat(t.substr(14),10)*1e3),h?(e.setUTCFullYear(r,i,a),e.setUTCHours(n,s,o,u),e.setTime(+e+f)):(e.setFullYear(r,i,a),e.setHours(n,s,o,u)),e};B.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var i=0;i=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};B.derToInteger=function(t){typeof t=="string"&&(t=N.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};B.validate=function(t,e,r,i){var a=!1;if((t.tagClass===e.tagClass||typeof e.tagClass=="undefined")&&(t.type===e.type||typeof e.type=="undefined"))if(t.constructed===e.constructed||typeof e.constructed=="undefined"){if(a=!0,e.value&&N.util.isArray(e.value))for(var n=0,s=0;a&&s0&&(i+="\n");for(var a="",n=0;n1?i+="0x"+N.util.bytesToHex(t.value.slice(1)):i+="(none)",t.value.length>0){var f=t.value.charCodeAt(0);f==1?i+=" (1 unused bit shown)":f>1&&(i+=" ("+f+" unused bits shown)")}}else if(t.type===B.Type.OCTETSTRING)Ve.test(t.value)||(i+="("+t.value+") "),i+="0x"+N.util.bytesToHex(t.value);else if(t.type===B.Type.UTF8)try{i+=N.util.decodeUtf8(t.value)}catch(h){if(h.message==="URI malformed")i+="0x"+N.util.bytesToHex(t.value)+" (malformed UTF8)";else throw h}else t.type===B.Type.PRINTABLESTRING||t.type===B.Type.IA5String?i+=t.value:Ve.test(t.value)?i+="0x"+N.util.bytesToHex(t.value):t.value.length===0?i+="[null]":i+=t.value}return i}});var xt=R(function(Ua,Xe){var te=D();Xe.exports=te.jsbn=te.jsbn||{};var j,Cr=0xdeadbeefcafe,Ge=(Cr&16777215)==15715070;function g(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}te.jsbn.BigInteger=g;function w(){return new g(null)}function Tr(t,e,r,i,a,n){for(;--n>=0;){var s=e*this.data[t++]+r.data[i]+a;a=Math.floor(s/67108864),r.data[i++]=s&67108863}return a}function Er(t,e,r,i,a,n){for(var s=e&32767,o=e>>15;--n>=0;){var u=this.data[t]&32767,f=this.data[t++]>>15,h=o*u+f*s;u=s*u+((h&32767)<<15)+r.data[i]+(a&1073741823),a=(u>>>30)+(h>>>15)+o*f+(a>>>30),r.data[i++]=u&1073741823}return a}function He(t,e,r,i,a,n){for(var s=e&16383,o=e>>14;--n>=0;){var u=this.data[t]&16383,f=this.data[t++]>>14,h=o*u+f*s;u=s*u+((h&16383)<<14)+r.data[i]+a,a=(u>>28)+(h>>14)+o*f,r.data[i++]=u&268435455}return a}typeof navigator=="undefined"?(g.prototype.am=He,j=28):Ge&&navigator.appName=="Microsoft Internet Explorer"?(g.prototype.am=Er,j=30):Ge&&navigator.appName!="Netscape"?(g.prototype.am=Tr,j=26):(g.prototype.am=He,j=28);g.prototype.DB=j;g.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}function br(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}function rt(t){var e=w();return e.fromInt(t),e}function wr(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var i=t.length,a=!1,n=0;--i>=0;){var s=r==8?t[i]&255:Qe(t,i);if(s<0){t.charAt(i)=="-"&&(a=!0);continue}a=!1,n==0?this.data[this.t++]=s:n+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-n):this.data[this.t-1]|=s<=this.DB&&(n-=this.DB)}r==8&&(t[0]&128)!=0&&(this.s=-1,n>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}function xr(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(o>o)>0&&(a=!0,n=We(i));s>=0;)o>(o+=this.DB-e)):(i=this.data[s]>>(o-=e)&r,o<=0&&(o+=this.DB,--s)),i>0&&(a=!0),a&&(n+=We(i));return a?n:"0"}function Lr(){var t=w();return g.ZERO.subTo(this,t),t}function Nr(){return this.s<0?this.negate():this}function Rr(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}function _t(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function Dr(){return this.t<=0?0:this.DB*(this.t-1)+_t(this.data[this.t-1]^this.s&this.DM)}function kr(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}function Fr(t,e){for(var r=t;r=0;--o)e.data[o+n+1]=this.data[o]>>i|s,s=(this.data[o]&a)<=0;--o)e.data[o]=0;e.data[n]=s,e.t=this.t+n+1,e.s=this.s,e.clamp()}function Ur(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var i=t%this.DB,a=this.DB-i,n=(1<>i;for(var s=r+1;s>i;i>0&&(e.data[this.t-r-1]|=(this.s&n)<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e.data[r++]=this.DV+i:i>0&&(e.data[r++]=i),e.t=r,e.clamp()}function Or(t,e){var r=this.abs(),i=t.abs(),a=r.t;for(e.t=a+i.t;--a>=0;)e.data[a]=0;for(a=0;a=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}function qr(t,e,r){var i=t.abs();if(!(i.t<=0)){var a=this.abs();if(a.t0?(i.lShiftTo(u,n),a.lShiftTo(u,r)):(i.copyTo(n),a.copyTo(r));var f=n.t,h=n.data[f-1];if(h!=0){var l=h*(1<1?n.data[f-2]>>this.F2:0),d=this.FV/l,m=(1<=0&&(r.data[r.t++]=1,r.subTo(E,r)),g.ONE.dlShiftTo(f,E),E.subTo(n,n);n.t=0;){var I=r.data[--S]==h?this.DM:Math.floor(r.data[S]*d+(r.data[S-1]+y)*m);if((r.data[S]+=n.am(0,I,r,C,0,f))0&&r.rShiftTo(u,r),s<0&&g.ZERO.subTo(r,r)}}}function Vr(t){var e=w();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(g.ZERO)>0&&t.subTo(e,e),e}function st(t){this.m=t}function zr(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function Gr(t){return t}function Hr(t){t.divRemTo(this.m,null,t)}function Wr(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function Qr(t,e){t.squareTo(e),this.reduce(e)}st.prototype.convert=zr;st.prototype.revert=Gr;st.prototype.reduce=Hr;st.prototype.mulTo=Wr;st.prototype.sqrTo=Qr;function Zr(){if(this.t<1)return 0;var t=this.data[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function ot(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}function Jr(t){var e=w();return t.copyTo(e),this.reduce(e),e}function Xr(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,i,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function $r(t,e){t.squareTo(e),this.reduce(e)}function jr(t,e,r){t.multiplyTo(e,r),this.reduce(r)}ot.prototype.convert=Yr;ot.prototype.revert=Jr;ot.prototype.reduce=Xr;ot.prototype.mulTo=jr;ot.prototype.sqrTo=$r;function ti(){return(this.t>0?this.data[0]&1:this.s)==0}function ei(t,e){if(t>4294967295||t<1)return g.ONE;var r=w(),i=w(),a=e.convert(this),n=_t(t)-1;for(a.copyTo(r);--n>=0;)if(e.sqrTo(r,i),(t&1<0)e.mulTo(i,a,r);else{var s=r;r=i,i=s}return e.revert(r)}function ri(t,e){var r;return t<256||e.isEven()?r=new st(e):r=new ot(e),this.exp(t,r)}g.prototype.copyTo=Ir;g.prototype.fromInt=br;g.prototype.fromString=wr;g.prototype.clamp=_r;g.prototype.dlShiftTo=kr;g.prototype.drShiftTo=Fr;g.prototype.lShiftTo=Pr;g.prototype.rShiftTo=Ur;g.prototype.subTo=Mr;g.prototype.multiplyTo=Or;g.prototype.squareTo=Kr;g.prototype.divRemTo=qr;g.prototype.invDigit=Zr;g.prototype.isEven=ti;g.prototype.exp=ei;g.prototype.toString=xr;g.prototype.negate=Lr;g.prototype.abs=Nr;g.prototype.compareTo=Rr;g.prototype.bitLength=Dr;g.prototype.mod=Vr;g.prototype.modPowInt=ri;g.ZERO=rt(0);g.ONE=rt(1);function ii(){var t=w();return this.copyTo(t),t}function ai(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}function si(){return this.t==0?this.s:this.data[0]<<16>>16}function oi(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function fi(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function ui(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=rt(r),a=w(),n=w(),s="";for(this.divRemTo(i,a,n);a.signum()>0;)s=(r+n.intValue()).toString(t).substr(1)+s,a.divRemTo(i,a,n);return n.intValue().toString(t)+s}function hi(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),i=Math.pow(e,r),a=!1,n=0,s=0,o=0;o=r&&(this.dMultiply(i),this.dAddOffset(s,0),n=0,s=0)}n>0&&(this.dMultiply(Math.pow(e,n)),this.dAddOffset(s,0)),a&&g.ZERO.subTo(this,this)}function li(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(g.ONE.shiftLeft(t-1),re,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(g.ONE.shiftLeft(t-1),this);else{var i=new Array,a=t&7;i.length=(t>>3)+1,e.nextBytes(i),a>0?i[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[a++]=i|this.s<=0;)r<8?(i=(this.data[t]&(1<>(r+=this.DB-8)):(i=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(i&128)!=0&&(i|=-256),a==0&&(this.s&128)!=(i&128)&&++a,(a>0||i!=this.s)&&(e[a++]=i);return e}function pi(t){return this.compareTo(t)==0}function di(t){return this.compareTo(t)<0?this:t}function gi(t){return this.compareTo(t)>0?this:t}function vi(t,e,r){var i,a,n=Math.min(t.t,this.t);for(i=0;i>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}function bi(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e.data[r++]=i:i<-1&&(e.data[r++]=this.DV+i),e.t=r,e.clamp()}function Fi(t){var e=w();return this.addTo(t,e),e}function Pi(t){var e=w();return this.subTo(t,e),e}function Ui(t){var e=w();return this.multiplyTo(t,e),e}function Mi(){var t=w();return this.squareTo(t),t}function Oi(t){var e=w();return this.divRemTo(t,e,null),e}function Ki(t){var e=w();return this.divRemTo(t,null,e),e}function qi(t){var e=w(),r=w();return this.divRemTo(t,e,r),new Array(e,r)}function Vi(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function zi(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}function yt(){}function Je(t){return t}function Gi(t,e,r){t.multiplyTo(e,r)}function Hi(t,e){t.squareTo(e)}yt.prototype.convert=Je;yt.prototype.revert=Je;yt.prototype.mulTo=Gi;yt.prototype.sqrTo=Hi;function Wi(t){return this.exp(t,new yt)}function Qi(t,e,r){var i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;var a;for(a=r.t-this.t;i=0;)r.data[i]=0;for(i=Math.max(e-this.t,0);i2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=w();return t.copyTo(e),this.reduce(e),e}function Ji(t){return t}function Xi(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function $i(t,e){t.squareTo(e),this.reduce(e)}function ji(t,e,r){t.multiplyTo(e,r),this.reduce(r)}lt.prototype.convert=Yi;lt.prototype.revert=Ji;lt.prototype.reduce=Xi;lt.prototype.mulTo=ji;lt.prototype.sqrTo=$i;function ta(t,e){var r=t.bitLength(),i,a=rt(1),n;if(r<=0)return a;r<18?i=1:r<48?i=3:r<144?i=4:r<768?i=5:i=6,r<8?n=new st(e):e.isEven()?n=new lt(e):n=new ot(e);var s=new Array,o=3,u=i-1,f=(1<1){var h=w();for(n.sqrTo(s[1],h);o<=f;)s[o]=w(),n.mulTo(h,s[o-2],s[o]),o+=2}var l=t.t-1,d,m=!0,y=w(),S;for(r=_t(t.data[l])-1;l>=0;){for(r>=u?d=t.data[l]>>r-u&f:(d=(t.data[l]&(1<0&&(d|=t.data[l-1]>>this.DB+r-u)),o=i;(d&1)==0;)d>>=1,--o;if((r-=o)<0&&(r+=this.DB,--l),m)s[d].copyTo(a),m=!1;else{for(;o>1;)n.sqrTo(a,y),n.sqrTo(y,a),o-=2;o>0?n.sqrTo(a,y):(S=a,a=y,y=S),n.mulTo(y,s[d],a)}for(;l>=0&&(t.data[l]&1<0&&(e.rShiftTo(n,e),r.rShiftTo(n,r));e.signum()>0;)(a=e.getLowestSetBit())>0&&e.rShiftTo(a,e),(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return n>0&&r.lShiftTo(n,r),r}function ra(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this.data[i])%t;return r}function ia(t){if(this.signum()==0)return g.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return g.ZERO;for(var r=t.clone(),i=this.clone(),a=rt(1),n=rt(0),s=rt(0),o=rt(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!a.isEven()||!n.isEven())&&(a.addTo(this,a),n.subTo(t,n)),a.rShiftTo(1,a)):n.isEven()||n.subTo(t,n),n.rShiftTo(1,n);for(;i.isEven();)i.rShiftTo(1,i),e?((!s.isEven()||!o.isEven())&&(s.addTo(this,s),o.subTo(t,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);r.compareTo(i)>=0?(r.subTo(i,r),e&&a.subTo(s,a),n.subTo(o,n)):(i.subTo(r,i),e&&s.subTo(a,s),o.subTo(n,o))}if(i.compareTo(g.ONE)!=0)return g.ZERO;if(o.compareTo(t)>=0)return o.subtract(t);if(o.signum()<0)o.addTo(t,o);else return o;return o.signum()<0?o.add(t):o}var W=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],aa=(1<<26)/W[W.length-1];function na(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=W[W.length-1]){for(e=0;e=0);var o=n.modPow(i,this);if(o.compareTo(g.ONE)!=0&&o.compareTo(e)!=0){for(var u=1;u++d&&(l=f(d,m)),l.isProbablePrime(S))return E(null,l);l.dAddOffset(r[y++%8],0)}while(C<0||+new Date-Il&&(S=f(l,d));var or=S.toString(16);oe.target.postMessage({hex:or,workLoad:E}),S.dAddOffset(I,0)}}}}function f(l,d){var m=new e(l,d),y=l-1;return m.testBit(y)||m.bitwiseTo(e.ONE.shiftLeft(y),a,m),m.dAddOffset(31-m.mod(i).byteValue(),0),m}function h(l){return l<=100?27:l<=150?18:l<=200?15:l<=250?12:l<=300?9:l<=350?8:l<=400?7:l<=500?6:l<=600?5:l<=800?4:l<=1250?3:2}})()});var nr=R(function(Oa,ar){var T=D();jt();xt();It();Xt();ae();dt();O();typeof _=="undefined"&&(_=T.jsbn.BigInteger);var _,ne=T.util.isNodejs?Yt():null,p=T.asn1,G=T.util;T.pki=T.pki||{};ar.exports=T.pki.rsa=T.rsa=T.rsa||{};var A=T.pki,fa=[6,4,2,4,2,4,6,2],ua={name:"PrivateKeyInfo",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:p.Class.UNIVERSAL,type:p.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},ha={name:"RSAPrivateKey",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},la={name:"RSAPublicKey",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:p.Class.UNIVERSAL,type:p.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},ca=T.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:p.Class.UNIVERSAL,type:p.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},pa={name:"DigestInfo",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:p.Class.UNIVERSAL,type:p.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:p.Class.UNIVERSAL,type:p.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:p.Class.UNIVERSAL,type:p.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:p.Class.UNIVERSAL,type:p.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},da=function(t){var e;if(t.algorithm in A.oids)e=A.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var i=p.oidToDer(e).getBytes(),a=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]),n=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[]);n.value.push(p.create(p.Class.UNIVERSAL,p.Type.OID,!1,i)),n.value.push(p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,""));var s=p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,t.digest().getBytes());return a.value.push(n),a.value.push(s),p.toDer(a).getBytes()},rr=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(_.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(_.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var i;do i=new _(T.util.bytesToHex(T.random.getBytes(e.n.bitLength()/8)),16);while(i.compareTo(e.n)>=0||!i.gcd(e.n).equals(_.ONE));t=t.multiply(i.modPow(e.e,e.n)).mod(e.n);for(var a=t.mod(e.p).modPow(e.dP,e.p),n=t.mod(e.q).modPow(e.dQ,e.q);a.compareTo(n)<0;)a=a.add(e.p);var s=a.subtract(n).multiply(e.qInv).mod(e.p).multiply(e.q).add(n);return s=s.multiply(i.modInverse(e.n)).mod(e.n),s};A.rsa.encrypt=function(t,e,r){var i=r,a,n=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(i=r===2,a=ir(t,e,r)):(a=T.util.createBuffer(),a.putBytes(t));for(var s=new _(a.toHex(),16),o=rr(s,e,i),u=o.toString(16),f=T.util.createBuffer(),h=n-Math.ceil(u.length/2);h>0;)f.putByte(0),--h;return f.putBytes(T.util.hexToBytes(u)),f.getBytes()};A.rsa.decrypt=function(t,e,r,i){var a=Math.ceil(e.n.bitLength()/8);if(t.length!==a){var n=new Error("Encrypted message length is invalid.");throw n.length=t.length,n.expected=a,n}var s=new _(T.util.createBuffer(t).toHex(),16);if(s.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=rr(s,e,r),u=o.toString(16),f=T.util.createBuffer(),h=a-Math.ceil(u.length/2);h>0;)f.putByte(0),--h;return f.putBytes(T.util.hexToBytes(u)),i!==!1?Lt(f.getBytes(),e,r):f.getBytes()};A.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var i=r.prng||T.random,a={nextBytes:function(o){for(var u=i.getBytesSync(o.length),f=0;f>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},s.e.fromInt(s.eInt);else throw new Error("Invalid key generation algorithm: "+n);return s};A.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new _(null);r.fromInt(30);for(var i=0,a=function(l,d){return l|d},n=+new Date,s,o=0;t.keys===null&&(e<=0||ou?t.pqState=0:t.num.isProbablePrime(va(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(fa[i++%8],0):t.pqState===2?t.pqState=t.num.subtract(_.ONE).gcd(t.e).compareTo(_.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(_.ONE),t.q1=t.q.subtract(_.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(_.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var h=t.e.modInverse(t.phi);t.keys={privateKey:A.rsa.setPrivateKey(t.n,t.e,h,t.p,t.q,h.mod(t.p1),h.mod(t.q1),t.q.modInverse(t.p)),publicKey:A.rsa.setPublicKey(t.n,t.e)}}s=+new Date,o+=s-n,n=s}return t.keys!==null};A.rsa.generateKeyPair=function(t,e,r,i){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(i=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(i=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,i=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(i=r,r=void 0):(i=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!T.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(i){if($e("generateKeyPair"))return ne.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,u,f){if(o)return i(o);i(null,{privateKey:A.privateKeyFromPem(f),publicKey:A.publicKeyFromPem(u)})});if(je("generateKey")&&je("exportKey"))return G.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:er(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return G.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){i(o)}).then(function(o){if(o){var u=A.privateKeyFromAsn1(p.fromDer(T.util.createBuffer(o)));i(null,{privateKey:u,publicKey:A.setRsaPublicKey(u.n,u.e)})}});if(tr("generateKey")&&tr("exportKey")){var a=G.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:er(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);a.oncomplete=function(o){var u=o.target.result,f=G.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);f.oncomplete=function(h){var l=h.target.result,d=A.privateKeyFromAsn1(p.fromDer(T.util.createBuffer(l)));i(null,{privateKey:d,publicKey:A.setRsaPublicKey(d.n,d.e)})},f.onerror=function(h){i(h)}},a.onerror=function(o){i(o)};return}}else if($e("generateKeyPairSync")){var n=ne.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:A.privateKeyFromPem(n.privateKey),publicKey:A.publicKeyFromPem(n.publicKey)}}}var s=A.rsa.createKeyPairGenerationState(t,e,r);if(!i)return A.rsa.stepKeyPairGenerationState(s,0),s.keys;ga(s,r,i)};A.setRsaPublicKey=A.rsa.setPublicKey=function(t,e){var r={n:t,e:e};return r.encrypt=function(i,a,n){if(typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSAES-PKCS1-V1_5"),a==="RSAES-PKCS1-V1_5")a={encode:function(o,u,f){return ir(o,u,2).getBytes()}};else if(a==="RSA-OAEP"||a==="RSAES-OAEP")a={encode:function(o,u){return T.pkcs1.encode_rsa_oaep(u,o,n)}};else if(["RAW","NONE","NULL",null].indexOf(a)!==-1)a={encode:function(o){return o}};else if(typeof a=="string")throw new Error('Unsupported encryption scheme: "'+a+'".');var s=a.encode(i,r,!0);return A.rsa.encrypt(s,r,!0)},r.verify=function(i,a,n,s){typeof n=="string"?n=n.toUpperCase():n===void 0&&(n="RSASSA-PKCS1-V1_5"),s===void 0&&(s={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in s||(s._parseAllDigestBytes=!0),"_skipPaddingChecks"in s||(s._skipPaddingChecks=!1),n==="RSASSA-PKCS1-V1_5"?n={verify:function(u,f){f=Lt(f,r,!0,void 0,s);var h=p.fromDer(f,{parseAllBytes:s._parseAllDigestBytes}),l={},d=[];if(!p.validate(h,pa,l,d)||h.value.length!==2){var m=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw m.errors=d,m}var y=p.derToOid(l.algorithmIdentifier);if(!(y===T.oids.md2||y===T.oids.md5||y===T.oids.sha1||y===T.oids.sha224||y===T.oids.sha256||y===T.oids.sha384||y===T.oids.sha512||y===T.oids["sha512-224"]||y===T.oids["sha512-256"])){var m=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw m.oid=y,m}if((y===T.oids.md2||y===T.oids.md5)&&!("parameters"in l))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return u===l.digest}}:(n==="NONE"||n==="NULL"||n===null)&&(n={verify:function(u,f){return f=Lt(f,r,!0,void 0,s),u===f}});var o=A.rsa.decrypt(a,r,!0,!1);return n.verify(i,o,r.n.bitLength())},r};A.setRsaPrivateKey=A.rsa.setPrivateKey=function(t,e,r,i,a,n,s,o){var u={n:t,e:e,d:r,p:i,q:a,dP:n,dQ:s,qInv:o};return u.decrypt=function(f,h,l){typeof h=="string"?h=h.toUpperCase():h===void 0&&(h="RSAES-PKCS1-V1_5");var d=A.rsa.decrypt(f,u,!1,!1);if(h==="RSAES-PKCS1-V1_5")h={decode:Lt};else if(h==="RSA-OAEP"||h==="RSAES-OAEP")h={decode:function(m,y){return T.pkcs1.decode_rsa_oaep(y,m,l)}};else if(["RAW","NONE","NULL",null].indexOf(h)!==-1)h={decode:function(m){return m}};else throw new Error('Unsupported encryption scheme: "'+h+'".');return h.decode(d,u,!1)},u.sign=function(f,h){var l=!1;typeof h=="string"&&(h=h.toUpperCase()),h===void 0||h==="RSASSA-PKCS1-V1_5"?(h={encode:da},l=1):(h==="NONE"||h==="NULL"||h===null)&&(h={encode:function(){return f}},l=1);var d=h.encode(f,u.n.bitLength());return A.rsa.encrypt(d,u,l)},u};A.wrapRsaPrivateKey=function(t){return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,p.integerToDer(0).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(A.oids.rsaEncryption).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,"")]),p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,p.toDer(t).getBytes())])};A.privateKeyFromAsn1=function(t){var e={},r=[];if(p.validate(t,ua,e,r)&&(t=p.fromDer(T.util.createBuffer(e.privateKey))),e={},r=[],!p.validate(t,ha,e,r)){var i=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw i.errors=r,i}var a,n,s,o,u,f,h,l;return a=T.util.createBuffer(e.privateKeyModulus).toHex(),n=T.util.createBuffer(e.privateKeyPublicExponent).toHex(),s=T.util.createBuffer(e.privateKeyPrivateExponent).toHex(),o=T.util.createBuffer(e.privateKeyPrime1).toHex(),u=T.util.createBuffer(e.privateKeyPrime2).toHex(),f=T.util.createBuffer(e.privateKeyExponent1).toHex(),h=T.util.createBuffer(e.privateKeyExponent2).toHex(),l=T.util.createBuffer(e.privateKeyCoefficient).toHex(),A.setRsaPrivateKey(new _(a,16),new _(n,16),new _(s,16),new _(o,16),new _(u,16),new _(f,16),new _(h,16),new _(l,16))};A.privateKeyToAsn1=A.privateKeyToRSAPrivateKey=function(t){return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,p.integerToDer(0).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,X(t.n)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,X(t.e)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,X(t.d)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,X(t.p)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,X(t.q)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,X(t.dP)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,X(t.dQ)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,X(t.qInv))])};A.publicKeyFromAsn1=function(t){var e={},r=[];if(p.validate(t,ca,e,r)){var i=p.derToOid(e.publicKeyOid);if(i!==A.oids.rsaEncryption){var a=new Error("Cannot read public key. Unknown OID.");throw a.oid=i,a}t=e.rsaPublicKey}if(r=[],!p.validate(t,la,e,r)){var a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw a.errors=r,a}var n=T.util.createBuffer(e.publicKeyModulus).toHex(),s=T.util.createBuffer(e.publicKeyExponent).toHex();return A.setRsaPublicKey(new _(n,16),new _(s,16))};A.publicKeyToAsn1=A.publicKeyToSubjectPublicKeyInfo=function(t){return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(A.oids.rsaEncryption).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,"")]),p.create(p.Class.UNIVERSAL,p.Type.BITSTRING,!1,[A.publicKeyToRSAPublicKey(t)])])};A.publicKeyToRSAPublicKey=function(t){return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,X(t.n)),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,X(t.e))])};function ir(t,e,r){var i=T.util.createBuffer(),a=Math.ceil(e.n.bitLength()/8);if(t.length>a-11){var n=new Error("Message is too long for PKCS#1 v1.5 padding.");throw n.length=t.length,n.max=a-11,n}i.putByte(0),i.putByte(r);var s=a-3-t.length,o;if(r===0||r===1){o=r===0?0:255;for(var u=0;u0;){for(var f=0,h=T.random.getBytes(s),u=0;u1;){if(s.getByte()!==255){--s.read;break}++f}if(f<8&&!(a&&a._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(u===2){for(f=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++f}if(f<8&&!(a&&a._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var l=s.getByte();if(l!==0||f!==n-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function ga(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var i={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(i.prng=e.prng),a();function a(){n(t.pBits,function(o,u){if(o)return r(o);if(t.p=u,t.q!==null)return s(o,t.q);n(t.qBits,s)})}function n(o,u){T.prime.generateProbablePrime(o,i,u)}function s(o,u){if(o)return r(o);if(t.q=u,t.p.compareTo(t.q)<0){var f=t.p;t.p=t.q,t.q=f}if(t.p.subtract(_.ONE).gcd(t.e).compareTo(_.ONE)!==0){t.p=null,a();return}if(t.q.subtract(_.ONE).gcd(t.e).compareTo(_.ONE)!==0){t.q=null,n(t.qBits,s);return}if(t.p1=t.p.subtract(_.ONE),t.q1=t.q.subtract(_.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(_.ONE)!==0){t.p=t.q=null,a();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,n(t.qBits,s);return}var h=t.e.modInverse(t.phi);t.keys={privateKey:A.rsa.setPrivateKey(t.n,t.e,h,t.p,t.q,h.mod(t.p1),h.mod(t.q1),t.q.modInverse(t.p)),publicKey:A.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}}function X(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=T.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&(r.charCodeAt(1)&128)===0||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}function va(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function $e(t){return T.util.isNodejs&&typeof ne[t]=="function"}function je(t){return typeof G.globalScope!="undefined"&&typeof G.globalScope.crypto=="object"&&typeof G.globalScope.crypto.subtle=="object"&&typeof G.globalScope.crypto.subtle[t]=="function"}function tr(t){return typeof G.globalScope!="undefined"&&typeof G.globalScope.msCrypto=="object"&&typeof G.globalScope.msCrypto.subtle=="object"&&typeof G.globalScope.msCrypto.subtle[t]=="function"}function er(t){for(var e=T.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),i=0;i