PageSourceSearch

https://www.elster.de/eportal/js-jeans/forge.js?v=4c38c1bc818bdd28d4e2f366b8a82fff

js elster.de collected 2026-10-01 09:14:37 UTC 294,919 bytes, 662 lines download raw bytes

1/*
2 https://github.com/digitalbazaar/forge/blob/master/LICENSE  ******************** !*\
3  !*** ./lib/aes.js ***!
4  \******************* no static exports found  ./forge  ./cipher  ./cipherModes  ./util  ******************************** !*\
5  !*** ./lib/aesCipherSuites.js ***!
6  \******************************* ./aes  ./tls  ******************************* !*\
7  !*** ./lib/asn1-validator.js ***!
8  \****************************** ./asn1  ********************* !*\
9  !*** ./lib/asn1.js ***!
10  \******************** ./oids  ********************** !*\
11  !*** ./lib/baseN.js ***!
12  \********************* *********************** !*\
13  !*** ./lib/cipher.js ***!
14  \********************** **************************** !*\
15  !*** ./lib/cipherModes.js ***!
16  \*************************** ******************** !*\
17  !*** ./lib/des.js ***!
18  \******************* ************************ !*\
19  !*** ./lib/ed25519.js ***!
20  \*********************** ./jsbn  ./random  ./sha512  ./asn1-validator  ********************** !*\
21  !*** ./lib/forge.js ***!
22  \********************* ********************* !*\
23  !*** ./lib/hmac.js ***!
24  \******************** ./md  ********************** !*\
25  !*** ./lib/index.js ***!
26  \********************* ./aesCipherSuites  ./des  ./ed25519  ./hmac  ./kem  ./log  ./md.all  ./mgf1  ./pbkdf2  ./pem  ./pkcs1  ./pkcs12  ./pkcs7  ./pki  ./prime  ./prng  ./pss  ./rc2  ./ssh  ********************* !*\
27  !*** ./lib/jsbn.js ***!
28  \******************** ******************** !*\
29  !*** ./lib/kem.js ***!
30  \******************* ******************** !*\
31  !*** ./lib/log.js ***!
32  \******************* *********************** !*\
33  !*** ./lib/md.all.js ***!
34  \********************** ./md5  ./sha1  ./sha256  ******************* !*\
35  !*** ./lib/md.js ***!
36  \****************** ******************** !*\
37  !*** ./lib/md5.js ***!
38  \******************* ******************** !*\
39  !*** ./lib/mgf.js ***!
40  \******************* ********************* !*\
41  !*** ./lib/mgf1.js ***!
42  \******************** ********************* !*\
43  !*** ./lib/oids.js ***!
44  \******************** ******************** !*\
45  !*** ./lib/pbe.js ***!
46  \******************* ./rsa  *********************** !*\
47  !*** ./lib/pbkdf2.js ***!
48  \********************** crypto  ******************** !*\
49  !*** ./lib/pem.js ***!
50  \******************* ********************** !*\
51  !*** ./lib/pkcs1.js ***!
52  \********************* *********************** !*\
53  !*** ./lib/pkcs12.js ***!
54  \********************** ./pkcs7asn1  ./pbe  ./x509  ********************** !*\
55  !*** ./lib/pkcs7.js ***!
56  \********************* ************************** !*\
57  !*** ./lib/pkcs7asn1.js ***!
58  \************************* ******************** !*\
59  !*** ./lib/pki.js ***!
60  \******************* ********************** !*\
61  !*** ./lib/prime.js ***!
62  \********************* ********************* !*\
63  !*** ./lib/prng.js ***!
64  \******************** ******************** !*\
65  !*** ./lib/pss.js ***!
66  \******************* *********************** !*\
67  !*** ./lib/random.js ***!
68  \********************** ******************** !*\
69  !*** ./lib/rc2.js ***!
70  \******************* ******************** !*\
71  !*** ./lib/rsa.js ***!
72  \******************* ********************* !*\
73  !*** ./lib/sha1.js ***!
74  \******************** *********************** !*\
75  !*** ./lib/sha256.js ***!
76  \********************** *********************** !*\
77  !*** ./lib/sha512.js ***!
78  \********************** ******************** !*\
79  !*** ./lib/ssh.js ***!
80  \******************* ******************** !*\
81  !*** ./lib/tls.js ***!
82  \******************* ********************* !*\
83  !*** ./lib/util.js ***!
84  \******************** ./baseN  ./../node_modules/webpack/buildin/global.js  ********************* !*\
85  !*** ./lib/x509.js ***!
86  \******************** ./mgf  *********************************** !*\
87  !*** (webpack)/buildin/global.js ***!
88  \********************************** **************************** !*\
89  !*** multi ./lib/index.js ***!
90  \*************************** ./lib/index.js  ************************ !*\
vendor: 4,475 bytes, lines 91-104
91  !*** crypto (ignored) ***!
92  \************************/
93var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(K){var r=0;return function(){return r<K.length?{done:!1,value:K[r++]}:{done:!0}}};$jscomp.arrayIterator=function(K){return{next:$jscomp.arrayIteratorImpl(K)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_ES6=!1;$jscomp.ASSUME_ES2020=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
94$jscomp.INSTRUMENT_ASYNC_CONTEXT=!0;$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(K,r,C){if(K==Array.prototype||K==Object.prototype)return K;K[r]=C.value;return K};
95$jscomp.getGlobal=function(K){K=["object"==typeof globalThis&&globalThis,K,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var r=0;r<K.length;++r){var C=K[r];if(C&&C.Math==Math)return C}throw Error("Cannot find global object");};$jscomp.global=$jscomp.ASSUME_ES2020?globalThis:$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE=typeof Symbol==="function"&&typeof Symbol("x")==="symbol";$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;
96$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(K,r,C){if(!C||K!=null){C=$jscomp.propertyToPolyfillSymbol[r];if(C==null)return K[r];C=K[C];return C!==void 0?C:K[r]}};$jscomp.TYPED_ARRAY_CLASSES=function(){var K="Int8 Uint8 Uint8Clamped Int16 Uint16 Int32 Uint32 Float32 Float64".split(" ");$jscomp.global.BigInt64Array&&(K.push("BigInt64"),K.push("BigUint64"));return K}();
97$jscomp.polyfillTypedArrayMethod=function(K,r,C,p){if(r)for(var E=0;E<$jscomp.TYPED_ARRAY_CLASSES.length;E++){var O=$jscomp.TYPED_ARRAY_CLASSES[E]+"Array.prototype."+K;$jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(O,r,C,p):$jscomp.polyfillUnisolated(O,r,C,p)}};$jscomp.polyfill=function(K,r,C,p){r&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(K,r,C,p):$jscomp.polyfillUnisolated(K,r,C,p))};
98$jscomp.polyfillUnisolated=function(K,r,C,p){C=$jscomp.global;K=K.split(".");for(p=0;p<K.length-1;p++){var E=K[p];if(!(E in C))return;C=C[E]}K=K[K.length-1];p=C[K];r=r(p);r!=p&&r!=null&&$jscomp.defineProperty(C,K,{configurable:!0,writable:!0,value:r})};
99$jscomp.polyfillIsolated=function(K,r,C,p){var E=K.split(".");K=E.length===1;p=E[0];p=!K&&p in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var O=0;O<E.length-1;O++){var y=E[O];if(!(y in p))return;p=p[y]}E=E[E.length-1];C=$jscomp.IS_SYMBOL_NATIVE&&C==="es6"?p[E]:null;r=r(C);r!=null&&(K?$jscomp.defineProperty($jscomp.polyfills,E,{configurable:!0,writable:!0,value:r}):r!==C&&($jscomp.propertyToPolyfillSymbol[E]===void 0&&(C=Math.random()*1E9>>>0,$jscomp.propertyToPolyfillSymbol[E]=$jscomp.IS_SYMBOL_NATIVE?
100$jscomp.global.Symbol(E):$jscomp.POLYFILL_PREFIX+C+"$"+E),$jscomp.defineProperty(p,$jscomp.propertyToPolyfillSymbol[E],{configurable:!0,writable:!0,value:r})))};$jscomp.initSymbol=function(){};
101$jscomp.polyfill("Symbol",function(K){if(K)return K;var r=function(O,y){this.$jscomp$symbol$id_=O;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:y})};r.prototype.toString=function(){return this.$jscomp$symbol$id_};var C="jscomp_symbol_"+(Math.random()*1E9>>>0)+"_",p=0,E=function(O){if(this instanceof E)throw new TypeError("Symbol is not a constructor");return new r(C+(O||"")+"_"+p++,O)};return E},"es6","es3");
102$jscomp.polyfill("Symbol.iterator",function(K){if(K)return K;K=Symbol("Symbol.iterator");$jscomp.defineProperty(Array.prototype,K,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});return K},"es6","es3");$jscomp.iteratorPrototype=function(K){K={next:K};K[Symbol.iterator]=function(){return this};return K};
103$jscomp.iteratorFromArray=function(K,r){if($jscomp.ASSUME_ES6)return K[Symbol.iterator]();K instanceof String&&(K+="");var C=0,p=!1,E={next:function(){if(!p&&C<K.length){var O=C++;return{value:r(O,K[O]),done:!1}}p=!0;return{done:!0,value:void 0}}};E[Symbol.iterator]=function(){return E};return E};$jscomp.polyfill("Array.prototype.keys",function(K){return K?K:function(){return $jscomp.iteratorFromArray(this,function(r){return r})}},"es6","es3");
104$jscomp.polyfill("Math.trunc",function(K){return K?K:function(r){r=Number(r);
104if(isNaN(r)||r===Infinity||r===-Infinity||r===0)return r;var C=Math.floor(Math.abs(r));return r<0?-C:C}},"es6","es3");$jscomp.atMethod=function(K){K=Math.trunc(K)||0;K<0&&(K+=this.length);if(!(K<0||K>=this.length))return this[K]};$jscomp.polyfill("Array.prototype.at",function(K){return K?K:$jscomp.atMethod},"es_next","es5");$jscomp.typedArrayAt=function(K){return K?K:$jscomp.atMethod};
105$jscomp.polyfillTypedArrayMethod("at",$jscomp.typedArrayAt,"es_next","es5");$jscomp.polyfill("String.prototype.at",function(K){return K?K:$jscomp.atMethod},"es_next","es5");$jscomp.polyfill("Array.prototype.values",function(K){return K?K:function(){return $jscomp.iteratorFromArray(this,function(r,C){return C})}},"es8","es3");
106(function(K,r){typeof exports==="object"&&typeof module==="object"?module.exports=r():typeof define==="function"&&define.amd?define([],r):typeof exports==="object"?exports.forge=r():K.forge=r()})(window,function(){return function(K){function r(p){if(C[p])return C[p].exports;var E=C[p]={i:p,l:!1,exports:{}};K[p].call(E.exports,E,E.exports,r);E.l=!0;return E.exports}var C={};r.m=K;r.c=C;r.d=function(p,E,O){r.o(p,E)||Object.defineProperty(p,E,{enumerable:!0,get:O})};r.r=function(p){typeof Symbol!=="undefined"&&
107Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"});Object.defineProperty(p,"__esModule",{value:!0})};r.t=function(p,E){E&1&&(p=r(p));if(E&8||E&4&&typeof p==="object"&&p&&p.__esModule)return p;var O=Object.create(null);r.r(O);Object.defineProperty(O,"default",{enumerable:!0,value:p});if(E&2&&typeof p!="string")for(var y in p)r.d(O,y,function(l){return p[l]}.bind(null,y));return O};r.n=function(p){var E=p&&p.__esModule?function(){return p["default"]}:function(){return p};
108r.d(E,"a",E);return E};r.o=function(p,E){return Object.prototype.hasOwnProperty.call(p,E)};r.p="";return r(r.s=0)}({
108"./lib/aes.js":function(K,r,C){function p(t,d){c.cipher.registerAlgorithm(t,function(){return new c.aes.Algorithm(t,d)})}function E(){a=!0;G=[0,1,2,4,8,16,32,64,128,27,54];for(var t=Array(256),d=0;d<128;++d)t[d]=d<<1,t[d+128]=d+128<<1^283;g=Array(256);u=Array(256);h=Array(4);B=Array(4);for(d=0;d<4;++d)h[d]=Array(256),B[d]=Array(256);var q=0,A=0;for(d=0;d<256;++d){var D=A^A<<1^A<<2^A<<
1093^A<<4;D=D>>8^D&255^99;g[q]=D;u[D]=q;var J=t[D];var k=t[q];var w=t[k];var f=t[w];J^=J<<24^D<<16^D<<8^D;w=(k^w^f)<<24^(q^f)<<16^(q^w^f)<<8^q^k^f;for(var e=0;e<4;++e)h[e][q]=J,B[e][D]=w,J=J<<24|J>>>8,w=w<<24|w>>>8;q===0?q=A=1:(q=k^t[t[t[k^f]]],A^=t[t[A]])}}function O(t,d){t=t.slice(0);for(var q,A=1,D=t.length,J=b*(D+6+1),k=D;k<J;++k)q=t[k-1],k%D===0?(q=g[q>>>16&255]<<24^g[q>>>8&255]<<16^g[q&255]<<8^g[q>>>24]^G[A]<<24,A++):D>6&&k%D===4&&(q=g[q>>>24]<<24^g[q>>>16&255]<<16^g[q>>>8&255]<<8^g[q&255]),t[k]=
110t[k-D]^q;if(d){q=B[0];A=B[1];D=B[2];var w=B[3],f=t.slice(0);J=t.length;k=0;for(var e=J-b;k<J;k+=b,e-=b)if(k===0||k===J-b)f[k]=t[e],f[k+1]=t[e+3],f[k+2]=t[e+2],f[k+3]=t[e+1];else for(var m=0;m<b;++m)d=t[e+m],f[k+(3&-m)]=q[g[d>>>24]]^A[g[d>>>16&255]]^D[g[d>>>8&255]]^w[g[d&255]];t=f}return t}function y(t,d,q,A){var D=t.length/4-1;if(A){var J=B[0];var k=B[1];var w=B[2];var f=B[3];var e=u}else J=h[0],k=h[1],w=h[2],f=h[3],e=g;var m=d[0]^t[0];var x=d[A?3:1]^t[1];var H=d[2]^t[2];d=d[A?1:3]^t[3];for(var L=
1113,P=1;P<D;++P){var Q=J[m>>>24]^k[x>>>16&255]^w[H>>>8&255]^f[d&255]^t[++L];var S=J[x>>>24]^k[H>>>16&255]^w[d>>>8&255]^f[m&255]^t[++L];var V=J[H>>>24]^k[d>>>16&255]^w[m>>>8&255]^f[x&255]^t[++L];d=J[d>>>24]^k[m>>>16&255]^w[x>>>8&255]^f[H&255]^t[++L];m=Q;x=S;H=V}q[0]=e[m>>>24]<<24^e[x>>>16&255]<<16^e[H>>>8&255]<<8^e[d&255]^t[++L];q[A?3:1]=e[x>>>24]<<24^e[H>>>16&255]<<16^e[d>>>8&255]<<8^e[m&255]^t[++L];q[2]=e[H>>>24]<<24^e[d>>>16&255]<<16^e[m>>>8&255]<<8^e[x&255]^t[++L];q[A?1:3]=e[d>>>24]<<24^e[m>>>16&
112255]<<16^e[x>>>8&255]<<8^e[H&255]^t[++L]}function l(t){t=t||{};var d="AES-"+(t.mode||"CBC").toUpperCase();var q=t.decrypt?c.cipher.createDecipher(d,t.key):c.cipher.createCipher(d,t.key);var A=q.start;q.start=function(D,J){var k=null;J instanceof c.util.ByteBuffer&&(k=J,J={});J=J||{};J.output=k;J.iv=D;A.call(q,J)};return q}var c=C("./lib/forge.js");C("./lib/cipher.js");C("./lib/cipherModes.js");C("./lib/util.js");K.exports=c.aes=c.aes||{};c.aes.startEncrypting=function(t,d,q,A){t=l({key:t,output:q,
113decrypt:!1,mode:A});t.start(d);return t};c.aes.createEncryptionCipher=function(t,d){return l({key:t,output:null,decrypt:!1,mode:d})};c.aes.startDecrypting=function(t,d,q,A){t=l({key:t,output:q,decrypt:!0,mode:A});t.start(d);return t};c.aes.createDecryptionCipher=function(t,d){return l({key:t,output:null,decrypt:!0,mode:d})};c.aes.Algorithm=function(t,d){a||E();var q=this;q.name=t;q.mode=new d({blockSize:16,cipher:{encrypt:function(A,D){return y(q._w,A,D,!1)},decrypt:function(A,D){return y(q._w,A,
114D,!0)}}});q._init=!1};c.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var d=t.key;if(typeof d==="string"&&(d.length===16||d.length===24||d.length===32))d=c.util.createBuffer(d);else if(c.util.isArray(d)&&(d.length===16||d.length===24||d.length===32)){var q=d;d=c.util.createBuffer();for(var A=0;A<q.length;++A)d.putByte(q[A])}if(!c.util.isArray(d)){q=d;d=[];var D=q.length();if(D===16||D===24||D===32)for(D>>>=2,A=0;A<D;++A)d.push(q.getInt32())}if(!c.util.isArray(d)||d.length!==4&&d.length!==
1156&&d.length!==8)throw Error("Invalid key parameter.");q=["CFB","OFB","CTR","GCM"].indexOf(this.mode.name)!==-1;this._w=O(d,t.decrypt&&!q);this._init=!0}};c.aes._expandKey=function(t,d){a||E();return O(t,d)};c.aes._updateBlock=y;p("AES-ECB",c.cipher.modes.ecb);p("AES-CBC",c.cipher.modes.cbc);p("AES-CFB",c.cipher.modes.cfb);p("AES-OFB",c.cipher.modes.ofb);p("AES-CTR",c.cipher.modes.ctr);p("AES-GCM",c.cipher.modes.gcm);var a=!1,b=4,g,u,G,h,B},
115"./lib/aesCipherSuites.js":function(K,r,C){function p(b,g,
116u){g=g.entity===c.tls.ConnectionEnd.client;b.read.cipherState={init:!1,cipher:c.cipher.createDecipher("AES-CBC",g?u.keys.server_write_key:u.keys.client_write_key),iv:g?u.keys.server_write_IV:u.keys.client_write_IV};b.write.cipherState={init:!1,cipher:c.cipher.createCipher("AES-CBC",g?u.keys.client_write_key:u.keys.server_write_key),iv:g?u.keys.client_write_IV:u.keys.server_write_IV};b.read.cipherFunction=l;b.write.cipherFunction=E;b.read.macLength=b.write.macLength=u.mac_length;b.read.macFunction=
117b.write.macFunction=a.hmac_sha1}function E(b,g){var u=!1,G=g.macFunction(g.macKey,g.sequenceNumber,b);b.fragment.putBytes(G);g.updateSequenceNumber();G=b.version.minor===a.Versions.TLS_1_0.minor?g.cipherState.init?null:g.cipherState.iv:c.random.getBytesSync(16);g.cipherState.init=!0;g=g.cipherState.cipher;g.start({iv:G});b.version.minor>=a.Versions.TLS_1_1.minor&&g.output.putBytes(G);g.update(b.fragment);g.finish(O)&&(b.fragment=g.output,b.length=b.fragment.length(),u=!0);return u}function O(b,g,
118u){u||(b-=g.length()%b,g.fillWithByte(b-1,b));return!0}function y(b,g,u){b=!0;if(u){u=g.length();for(var G=g.last(),h=u-1-G;h<u-1;++h)b=b&&g.at(h)==G;b&&g.truncate(G+1)}return b}function l(b,g){var u=b.version.minor===a.Versions.TLS_1_0.minor?g.cipherState.init?null:g.cipherState.iv:b.fragment.getBytes(16);g.cipherState.init=!0;var G=g.cipherState.cipher;G.start({iv:u});G.update(b.fragment);u=G.finish(y);var h=g.macLength,B=c.random.getBytesSync(h),t=G.output.length();t>=h?(b.fragment=G.output.getBytes(t-
119h),B=G.output.getBytes(h)):b.fragment=G.output.getBytes();b.fragment=c.util.createBuffer(b.fragment);b.length=b.fragment.length();b=g.macFunction(g.macKey,g.sequenceNumber,b);g.updateSequenceNumber();g=g.macKey;G=c.hmac.create();G.start("SHA1",g);G.update(B);B=G.digest().getBytes();G.start(null,null);G.update(b);b=G.digest().getBytes();return B===b&&u}var c=C("./lib/forge.js");C("./lib/aes.js");C("./lib/tls.js");var a=K.exports=c.tls;a.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",
120initSecurityParameters:function(b){b.bulk_cipher_algorithm=a.BulkCipherAlgorithm.aes;b.cipher_type=a.CipherType.block;b.enc_key_length=16;b.block_length=16;b.fixed_iv_length=16;b.record_iv_length=16;b.mac_algorithm=a.MACAlgorithm.hmac_sha1;b.mac_length=20;b.mac_key_length=20},initConnectionState:p};a.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(b){b.bulk_cipher_algorithm=a.BulkCipherAlgorithm.aes;b.cipher_type=a.CipherType.block;
121b.enc_key_length=32;b.block_length=16;b.fixed_iv_length=16;b.record_iv_length=16;b.mac_algorithm=a.MACAlgorithm.hmac_sha1;b.mac_length=20;b.mac_key_length=20},initConnectionState:p}},
121"./lib/asn1-validator.js":function(K,r,C){K=C("./lib/forge.js");C("./lib/asn1.js");C=K.asn1;r.privateKeyValidator={name:"PrivateKeyInfo",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},
122{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:C.Class.UNIVERSAL,type:C.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};r.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",
123tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:C.Class.UNIVERSAL,type:C.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},
123"./lib/asn1.js":function(K,r,C){function p(c,a,b){if(b>a){var g=Error("Too few bytes to parse DER.");g.available=c.length();g.remaining=a;g.requested=b;throw g;}}function E(c,a,b,g){if(b>=
124g.maxDepth)throw Error("ASN.1 parsing error: Max depth exceeded.");p(c,a,2);var u=c.getByte();a--;var G=u&192,h=u&31;var B=c.length();var t=a;var d=c.getByte();t--;if(d===128)t=void 0;else if(d&128?(d&=127,p(c,t,d),t=c.getInt(d<<3)):t=d,t<0)throw Error("Negative length: "+t);a-=B-c.length();if(t!==void 0&&t>a){if(g.strict)throw b=Error("Too few bytes to read ASN.1 value."),b.available=c.length(),b.remaining=a,b.requested=t,b;t=a}var q;if(u=(u&32)===32){var A=[];if(t===void 0)for(;;){p(c,a,2);if(c.bytes(2)===
125String.fromCharCode(0,0)){c.getBytes(2);a-=2;break}B=c.length();A.push(E(c,a,b+1,g));a-=B-c.length()}else for(;t>0;)B=c.length(),A.push(E(c,t,b+1,g)),a-=B-c.length(),t-=B-c.length()}A===void 0&&G===y.Class.UNIVERSAL&&h===y.Type.BITSTRING&&(q=c.bytes(t));if(A===void 0&&g.decodeBitStrings&&G===y.Class.UNIVERSAL&&h===y.Type.BITSTRING&&t>1){d=c.read;var D=a,J=0;h===y.Type.BITSTRING&&(p(c,a,1),J=c.getByte(),a--);if(J===0)try{B=c.length();var k=E(c,a,b+1,{strict:!0,decodeBitStrings:!0}),w=B-c.length();
126a-=w;h==y.Type.BITSTRING&&w++;var f=k.tagClass;w!==t||f!==y.Class.UNIVERSAL&&f!==y.Class.CONTEXT_SPECIFIC||(A=[k])}catch(e){}A===void 0&&(c.read=d,a=D)}if(A===void 0){if(t===void 0){if(g.strict)throw Error("Non-constructed ASN.1 object of indefinite length.");t=a}if(h===y.Type.BMPSTRING)for(A="";t>0;t-=2)p(c,a,2),A+=String.fromCharCode(c.getInt16()),a-=2;else A=c.getBytes(t)}return y.create(G,h,u,A,q===void 0?null:{bitStringContents:q})}var O=C("./lib/forge.js");C("./lib/util.js");C("./lib/oids.js");
127var y=K.exports=O.asn1=O.asn1||{};y.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};y.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};y.maxDepth=256;y.create=function(c,a,b,g,u){if(O.util.isArray(g)){for(var G=[],h=0;h<g.length;++h)g[h]!==void 0&&G.push(g[h]);g=G}c={tagClass:c,type:a,constructed:b,
128composed:b||O.util.isArray(g),value:g};u&&"bitStringContents"in u&&(c.bitStringContents=u.bitStringContents,c.original=y.copy(c));return c};y.copy=function(c,a){if(O.util.isArray(c)){var b=[];for(var g=0;g<c.length;++g)b.push(y.copy(c[g],a));return b}
128if(typeof c==="string")return c;b={tagClass:c.tagClass,type:c.type,constructed:c.constructed,composed:c.composed,value:y.copy(c.value,a)};a&&!a.excludeBitStringContents&&(b.bitStringContents=c.bitStringContents);return b};y.equals=function(c,a,b){if(O.util.isArray(c)){if(!O.util.isArray(a)||
129c.length!==a.length)return!1;for(b=0;b<c.length;++b)if(!y.equals(c[b],a[b]))return!1;return!0}if(typeof c!==typeof a)return!1;if(typeof c==="string")return c===a;var g=c.tagClass===a.tagClass&&c.type===a.type&&c.constructed===a.constructed&&c.composed===a.composed&&y.equals(c.value,a.value);b&&b.includeBitStringContents&&(g=g&&c.bitStringContents===a.bitStringContents);return g};y.getBerValueLength=function(c){var a=c.getByte();if(a!==128)return a&128?c.getInt((a&127)<<3):a};y.fromDer=function(c,
130a){a===void 0&&(a={strict:!0,parseAllBytes:!0,decodeBitStrings:!0});typeof a==="boolean"&&(a={strict:a,parseAllBytes:!0,decodeBitStrings:!0});"strict"in a||(a.strict=!0);"parseAllBytes"in a||(a.parseAllBytes=!0);"decodeBitStrings"in a||(a.decodeBitStrings=!0);"maxDepth"in a||(a.maxDepth=y.maxDepth);
130typeof c==="string"&&(c=O.util.createBuffer(c));var b=c.length(),g=E(c,c.length(),0,a);if(a.parseAllBytes&&c.length()!==0)throw a=Error("Unparsed DER bytes remain after ASN.1 parsing."),a.byteCount=b,a.remaining=
131c.length(),a;return g};y.toDer=function(c){var a=O.util.createBuffer(),b=c.tagClass|c.type,g=O.util.createBuffer(),u=!1;"bitStringContents"in c&&(u=!0,c.original&&(u=y.equals(c,c.original)));if(u)g.putBytes(c.bitStringContents);else if(c.composed)for(c.constructed?b|=32:g.putByte(0),u=0;u<c.value.length;++u)c.value[u]!==void 0&&g.putBuffer(y.toDer(c.value[u]));else if(c.type===y.Type.BMPSTRING)for(u=0;u<c.value.length;++u)g.putInt16(c.value.charCodeAt(u));else c.type===y.Type.INTEGER&&c.value.length>
1321&&(c.value.charCodeAt(0)===0&&(c.value.charCodeAt(1)&128)===0||c.value.charCodeAt(0)===255&&(c.value.charCodeAt(1)&128)===128)?g.putBytes(c.value.substr(1)):g.putBytes(c.value);a.putByte(b);if(g.length()<=127)a.putByte(g.length()&127);else{b=g.length();c="";do c+=String.fromCharCode(b&255),b>>>=8;while(b>0);a.putByte(c.length|128);for(u=c.length-1;u>=0;--u)a.putByte(c.charCodeAt(u))}a.putBuffer(g);return a};y.oidToDer=function(c){c=c.split(".");var a=O.util.createBuffer();a.putByte(40*parseInt(c[0],
13310)+parseInt(c[1],10));for(var b,g,u,G,h=2;h<c.length;++h){b=!0;g=[];u=parseInt(c[h],10);if(u>4294967295)throw Error("OID value too large; max is 32-bits.");do G=u&127,u>>>=7,b||(G|=128),g.push(G),b=!1;while(u>0);for(b=g.length-1;b>=0;--b)a.putByte(g[b])}return a};
133y.derToOid=function(c){typeof c==="string"&&(c=O.util.createBuffer(c));var a=c.getByte();var b=Math.floor(a/40)+"."+a%40;for(var g=0;c.length()>0;){if(g>70368744177663)throw Error("OID value too large; max is 53-bits.");a=c.getByte();g*=
134128;a&128?g+=a&127:(b+="."+(g+a),g=0)}return b};y.utcTimeToDate=function(c){var a=new Date,b=parseInt(c.substr(0,2),10);b=b>=50?1900+b:2E3+b;var g=parseInt(c.substr(2,2),10)-1,u=parseInt(c.substr(4,2),10),G=parseInt(c.substr(6,2),10),h=parseInt(c.substr(8,2),10),B=0;if(c.length>11){var t=c.charAt(10),d=10;t!=="+"&&t!=="-"&&(B=parseInt(c.substr(10,2),10),d+=2)}a.setUTCFullYear(b,g,u);a.setUTCHours(G,h,B,0);d&&(t=c.charAt(d),t==="+"||t==="-")&&(b=parseInt(c.substr(d+1,2),10),c=parseInt(c.substr(d+4,
1352),10),c=(b*60+c)*6E4,t==="+"?a.setTime(+a-c):a.setTime(+a+c));return a};y.generalizedTimeToDate=function(c){var a=new Date,b=parseInt(c.substr(0,4),10),g=parseInt(c.substr(4,2),10)-1,u=parseInt(c.substr(6,2),10),G=parseInt(c.substr(8,2),10),h=parseInt(c.substr(10,2),10),B=parseInt(c.substr(12,2),10),t=0,d=0,q=!1;c.charAt(c.length-1)==="Z"&&(q=!0);var A=c.length-5,D=c.charAt(A);if(D==="+"||D==="-")d=parseInt(c.substr(A+1,2),10),A=parseInt(c.substr(A+4,2),10),d=(d*60+A)*6E4,D==="+"&&(d*=-1),q=!0;c.charAt(14)===
136"."&&(t=parseFloat(c.substr(14),10)*1E3);q?(a.setUTCFullYear(b,g,u),a.setUTCHours(G,h,B,t),a.setTime(+a+d)):(a.setFullYear(b,g,u),a.setHours(G,h,B,t));return a};
136y.dateToUtcTime=function(c){if(typeof c==="string")return c;var a="",b=[];b.push((""+c.getUTCFullYear()).substr(2));b.push(""+(c.getUTCMonth()+1));b.push(""+c.getUTCDate());b.push(""+c.getUTCHours());b.push(""+c.getUTCMinutes());b.push(""+c.getUTCSeconds());for(c=0;c<b.length;++c)b[c].length<2&&(a+="0"),a+=b[c];return a+"Z"};y.dateToGeneralizedTime=
137function(c){if(typeof c==="string")return c;var a="",b=[];b.push(""+c.getUTCFullYear());b.push(""+(c.getUTCMonth()+1));b.push(""+c.getUTCDate());b.push(""+c.getUTCHours());b.push(""+c.getUTCMinutes());b.push(""+c.getUTCSeconds());for(c=0;c<b.length;++c)b[c].length<2&&(a+="0"),a+=b[c];return a+"Z"};y.integerToDer=function(c){var a=O.util.createBuffer();if(c>=-128&&c<128)return a.putSignedInt(c,8);if(c>=-32768&&c<32768)return a.putSignedInt(c,16);if(c>=-8388608&&c<8388608)return a.putSignedInt(c,24);
138if(c>=-2147483648&&c<2147483648)return a.putSignedInt(c,32);a=Error("Integer too large; max is 32-bits.");a.integer=c;throw a;};y.derToInteger=function(c){typeof c==="string"&&(c=O.util.createBuffer(c));var a=c.length()*8;if(a>32)throw Error("Integer too large; max is 32-bits.");return c.getSignedInt(a)};y.validate=function(c,a,b,g){var u=!1;if(c.tagClass!==a.tagClass&&typeof a.tagClass!=="undefined"||c.type!==a.type&&typeof a.type!=="undefined")g&&(c.tagClass!==a.tagClass&&g.push("["+a.name+'] Expected tag class "'+
139a.tagClass+'", got "'+c.tagClass+'"'),c.type!==a.type&&g.push("["+a.name+'] Expected type "'+a.type+'", got "'+c.type+'"'));else if(c.constructed===a.constructed||typeof a.constructed==="undefined"){u=!0;if(a.value&&O.util.isArray(a.value))for(var G=0,h=0;u&&h<a.value.length;++h){var B=a.value[h];u=!!B.optional;var t=c.value[G];if(t){if(typeof B.tagClass!=="undefined"&&typeof B.type!=="undefined"&&(t.tagClass!==B.tagClass||t.type!==B.type))if(B.optional){u=!0;continue}else{u=!1;g&&g.push("["+a.name+
140"] Tag mismatch. Expected ("+B.tagClass+","+B.type+"), got ("+t.tagClass+","+t.type+")");break}if(y.validate(t,B,b,g))++G,u=!0;else if(B.optional)u=!0;else{u=!1;break}}else B.optional||(u=!1,g&&g.push("["+a.name+'] Missing required element. Expected tag class "'+B.tagClass+'", type "'+B.type+'"'))}if(u&&b&&(a.capture&&(b[a.capture]=c.value),a.captureAsn1&&(b[a.captureAsn1]=c),a.captureBitStringContents&&"bitStringContents"in c&&(b[a.captureBitStringContents]=c.bitStringContents),a.captureBitStringValue&&
141"bitStringContents"in c))if(c.bitStringContents.length<2)b[a.captureBitStringValue]="";
141else{if(c.bitStringContents.charCodeAt(0)!==0)throw Error("captureBitStringValue only supported for zero unused bits");b[a.captureBitStringValue]=c.bitStringContents.slice(1)}}else g&&g.push("["+a.name+'] Expected constructed "'+a.constructed+'", got "'+c.constructed+'"');return u};var l=/[^\\u0000-\\u00ff]/;y.prettyPrint=function(c,a,b){var g="";a=a||0;b=b||2;a>0&&(g+="\n");for(var u="",G=0;G<a*b;++G)u+=" ";g+=
142u+"Tag: ";switch(c.tagClass){case y.Class.UNIVERSAL:g+="Universal:";break;case y.Class.APPLICATION:g+="Application:";break;case y.Class.CONTEXT_SPECIFIC:g+="Context-Specific:";break;case y.Class.PRIVATE:g+="Private:"}if(c.tagClass===y.Class.UNIVERSAL)switch(g+=c.type,c.type){case y.Type.NONE:g+=" (None)";break;case y.Type.BOOLEAN:g+=" (Boolean)";break;case y.Type.INTEGER:g+=" (Integer)";break;case y.Type.BITSTRING:g+=" (Bit string)";break;case y.Type.OCTETSTRING:g+=" (Octet string)";break;case y.Type.NULL:g+=
143" (Null)";break;case y.Type.OID:g+=" (Object Identifier)";break;case y.Type.ODESC:g+=" (Object Descriptor)";break;case y.Type.EXTERNAL:g+=" (External or Instance of)";break;case y.Type.REAL:g+=" (Real)";break;case y.Type.ENUMERATED:g+=" (Enumerated)";break;case y.Type.EMBEDDED:g+=" (Embedded PDV)";break;case y.Type.UTF8:g+=" (UTF8)";break;case y.Type.ROID:g+=" (Relative Object Identifier)";break;case y.Type.SEQUENCE:g+=" (Sequence)";break;case y.Type.SET:g+=" (Set)";break;case y.Type.PRINTABLESTRING:g+=
144" (Printable String)";break;case y.Type.IA5String:g+=" (IA5String (ASCII))";break;case y.Type.UTCTIME:g+=" (UTC time)";break;case y.Type.GENERALIZEDTIME:g+=" (Generalized time)";break;case y.Type.BMPSTRING:g+=" (BMP String)"}else g+=c.type;g=g+"\n"+(u+"Constructed: "+c.constructed+"\n");if(c.composed){var h=0,B="";for(G=0;G<c.value.length;++G)c.value[G]!==void 0&&(h+=1,B+=y.prettyPrint(c.value[G],a+1,b),G+1<c.value.length&&(B+=","));g+=u+"Sub values: "+h+B}else if(g+=u+"Value: ",c.type===y.Type.OID&&
145(a=y.derToOid(c.value),g+=a,O.pki&&O.pki.oids&&a in O.pki.oids&&(g+=" ("+O.pki.oids[a]+") ")),c.type===y.Type.INTEGER)try{g+=y.derToInteger(c.value)}catch(t){g+="0x"+O.util.bytesToHex(c.value)}else if(c.type===y.Type.BITSTRING)g=c.value.length>1?g+("0x"+O.util.bytesToHex(c.value.slice(1))):g+"(none)",c.value.length>0&&(c=c.value.charCodeAt(0),c==1?g+=" (1 unused bit shown)":c>1&&(g+=" ("+c+" unused bits shown)"));else if(c.type===y.Type.OCTETSTRING)l.test(c.value)||(g+="("+c.value+") "),g+="0x"+O.util.bytesToHex(c.value);
146else if(c.type===y.Type.UTF8)try{g+=O.util.decodeUtf8(c.value)}catch(t){if(t.message==="URI malformed")g+="0x"+O.util.bytesToHex(c.value)+" (malformed UTF8)";else throw t;}else g=c.type===y.Type.PRINTABLESTRING||c.type===y.Type.IA5String?g+c.value:l.test(c.value)?g+("0x"+O.util.bytesToHex(c.value)):c.value.length===0?g+"[null]":g+c.value;return g}},
146"./lib/baseN.js":function(K,r){r={};K.exports=r;var C={};r.encode=function(p,E,O){if(typeof E!=="string")throw new TypeError('"alphabet" must be a string.');
147if(O!==void 0&&typeof O!=="number")throw new TypeError('"maxline" must be a number.');var y="";if(p instanceof Uint8Array){var l,c=E.length,a=E.charAt(0),b=[0];for(l=0;l<p.length;++l){for(var g=0,u=p[l];g<b.length;++g)u+=b[g]<<8,b[g]=u%c,u=u/c|0;for(;u>0;)b.push(u%c),u=u/c|0}for(l=0;p[l]===0&&l<p.length-1;++l)y+=a;for(l=b.length-1;l>=0;--l)y+=E[b[l]]}else{a=E.length;l=E.charAt(0);c=[0];for(y=0;y<p.length();++y){b=0;for(g=p.at(y);b<c.length;++b)g+=c[b]<<8,c[b]=g%a,g=g/a|0;for(;g>0;)c.push(g%a),g=g/
148a|0}a="";for(y=0;p.at(y)===0&&y<p.length()-1;++y)a+=l;for(y=c.length-1;y>=0;--y)a+=E[c[y]];y=a}O&&(y=y.match(new RegExp(".{1,"+O+"}","g")).join("\r\n"));return y};r.decode=function(p,E){if(typeof p!=="string")throw new TypeError('"input" must be a string.');if(typeof E!=="string")throw new TypeError('"alphabet" must be a string.');var O=C[E];if(!O){O=C[E]=[];for(var y=0;y<E.length;++y)O[E.charCodeAt(y)]=y}p=p.replace(/\s/g,"");var l=E.length;E=E.charAt(0);var c=[0];for(y=0;y<p.length;y++){var a=O[p.charCodeAt(y)];
149if(a===void 0)return;for(var b=0;b<c.length;++b)a+=c[b]*l,c[b]=a&255,a>>=8;for(;a>0;)c.push(a&255),a>>=8}for(O=0;p[O]===E&&O<p.length-1;++O)c.push(0);return typeof Buffer!=="undefined"?Buffer.from(c.reverse()):new Uint8Array(c.reverse())}},
149"./lib/cipher.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/util.js");K.exports=p.cipher=p.cipher||{};p.cipher.algorithms=p.cipher.algorithms||{};p.cipher.createCipher=function(E,O){var y=E;typeof y==="string"&&(y=p.cipher.getAlgorithm(y))&&(y=y());if(!y)throw Error("Unsupported algorithm: "+
150E);return new p.cipher.BlockCipher({algorithm:y,key:O,decrypt:!1})};p.cipher.createDecipher=function(E,O){var y=E;typeof y==="string"&&(y=p.cipher.getAlgorithm(y))&&(y=y());if(!y)throw Error("Unsupported algorithm: "+E);return new p.cipher.BlockCipher({algorithm:y,key:O,decrypt:!0})};p.cipher.registerAlgorithm=function(E,O){E=E.toUpperCase();p.cipher.algorithms[E]=O};p.cipher.getAlgorithm=function(E){E=E.toUpperCase();return E in p.cipher.algorithms?p.cipher.algorithms[E]:null};K=p.cipher.BlockCipher=
151function(E){this.algorithm=E.algorithm;this.mode=this.algorithm.mode;this.blockSize=this.mode.blockSize;this._finish=!1;this.output=this._input=null;this._op=E.decrypt?this.mode.decrypt:this.mode.encrypt;this._decrypt=E.decrypt;this.algorithm.initialize(E)};K.prototype.start=function(E){E=E||{};var O={},y;for(y in E)O[y]=E[y];O.decrypt=this._decrypt;this._finish=!1;this._input=p.util.createBuffer();this.output=E.output||p.util.createBuffer();this.mode.start(O)};K.prototype.update=function(E){for(E&&
152this._input.putBuffer(E);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};K.prototype.finish=function(E){!E||this.mode.name!=="ECB"&&this.mode.name!=="CBC"||(this.mode.pad=function(y){return E(this.blockSize,y,!1)},this.mode.unpad=function(y){return E(this.blockSize,y,!0)});var O={};O.decrypt=this._decrypt;O.overflow=this._input.length()%this.blockSize;if(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,O))return!1;this._finish=!0;this.update();
153return this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,O)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,O)?!1:!0}},
153"./lib/cipherModes.js":function(K,r,C){function p(l,c){typeof l==="string"&&(l=y.util.createBuffer(l));if(y.util.isArray(l)&&l.length>4){var a=l;l=y.util.createBuffer();for(var b=0;b<a.length;++b)l.putByte(a[b])}if(l.length()<c)throw Error("Invalid IV length; got "+l.length()+" bytes and expected "+c+" bytes.");if(!y.util.isArray(l)){a=[];c/=4;for(b=0;b<c;++b)a.push(l.getInt32());
154l=a}return l}function E(l){l[l.length-1]=l[l.length-1]+1&4294967295}function O(l){return[l/4294967296|0,l&4294967295]}var y=C("./lib/forge.js");C("./lib/util.js");y.cipher=y.cipher||{};K=K.exports=y.cipher.modes=y.cipher.modes||{};K.ecb=function(l){l=l||{};this.name="ECB";this.cipher=l.cipher;this.blockSize=l.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);this._outBlock=Array(this._ints)};K.ecb.prototype.start=function(l){};K.ecb.prototype.encrypt=function(l,c,a){if(l.length()<
155this.blockSize&&!(a&&l.length()>0))return!0;for(a=0;a<this._ints;++a)this._inBlock[a]=l.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(a=0;a<this._ints;++a)c.putInt32(this._outBlock[a])};K.ecb.prototype.decrypt=function(l,c,a){if(l.length()<this.blockSize&&!(a&&l.length()>0))return!0;for(a=0;a<this._ints;++a)this._inBlock[a]=l.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(a=0;a<this._ints;++a)c.putInt32(this._outBlock[a])};K.ecb.prototype.pad=function(l,c){c=l.length()===
156this.blockSize?this.blockSize:this.blockSize-l.length();l.fillWithByte(c,c);return!0};K.ecb.prototype.unpad=function(l,c){if(c.overflow>0)return!1;c=l.length();c=l.at(c-1);if(c>this.blockSize<<2)return!1;l.truncate(c);return!0};K.cbc=function(l){l=l||{};this.name="CBC";this.cipher=l.cipher;this.blockSize=l.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);this._outBlock=Array(this._ints)};K.cbc.prototype.start=function(l){if(l.iv===null){if(!this._prev)throw Error("Invalid IV parameter.");
157this._iv=this._prev.slice(0)}else if("iv"in l)this._iv=p(l.iv,this.blockSize),this._prev=this._iv.slice(0);else throw Error("Invalid IV parameter.");};K.cbc.prototype.encrypt=function(l,c,a){if(l.length()<this.blockSize&&!(a&&l.length()>0))return!0;for(a=0;a<this._ints;++a)this._inBlock[a]=this._prev[a]^l.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(a=0;a<this._ints;++a)c.putInt32(this._outBlock[a]);this._prev=this._outBlock};K.cbc.prototype.decrypt=function(l,c,a){if(l.length()<
158this.blockSize&&!(a&&l.length()>0))return!0;for(a=0;a<this._ints;++a)this._inBlock[a]=l.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(a=0;a<this._ints;++a)c.putInt32(this._prev[a]^this._outBlock[a]);this._prev=this._inBlock.slice(0)};K.cbc.prototype.pad=function(l,c){c=l.length()===this.blockSize?this.blockSize:this.blockSize-l.length();l.fillWithByte(c,c);return!0};K.cbc.prototype.unpad=function(l,c){if(c.overflow>0)return!1;c=l.length();c=l.at(c-1);if(c>this.blockSize<<2)return!1;
159l.truncate(c);return!0};K.cfb=function(l){l=l||{};this.name="CFB";this.cipher=l.cipher;this.blockSize=l.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialBlock=Array(this._ints);this._partialOutput=y.util.createBuffer();this._partialBytes=0};K.cfb.prototype.start=function(l){if(!("iv"in l))throw Error("Invalid IV parameter.");this._iv=p(l.iv,this.blockSize);this._inBlock=this._iv.slice(0);this._partialBytes=0};K.cfb.prototype.encrypt=function(l,
160c,a){var b=l.length();if(b===0)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(this._partialBytes===0&&b>=this.blockSize)for(var g=0;g<this._ints;++g)this._inBlock[g]=l.getInt32()^this._outBlock[g],c.putInt32(this._inBlock[g]);else{var u=(this.blockSize-b)%this.blockSize;u>0&&(u=this.blockSize-u);this._partialOutput.clear();for(g=0;g<this._ints;++g)this._partialBlock[g]=l.getInt32()^this._outBlock[g],this._partialOutput.putInt32(this._partialBlock[g]);if(u>0)l.read-=this.blockSize;else for(g=
1610;g<this._ints;++g)this._inBlock[g]=this._partialBlock[g];this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes);if(u>0&&!a)return c.putBytes(this._partialOutput.getBytes(u-this._partialBytes)),this._partialBytes=u,!0;c.putBytes(this._partialOutput.getBytes(b-this._partialBytes));this._partialBytes=0}};K.cfb.prototype.decrypt=function(l,c,a){var b=l.length();if(b===0)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(this._partialBytes===0&&b>=this.blockSize)for(var g=0;g<
162this._ints;++g)this._inBlock[g]=l.getInt32(),c.putInt32(this._inBlock[g]^this._outBlock[g]);else{var u=(this.blockSize-b)%this.blockSize;u>0&&(u=this.blockSize-u);this._partialOutput.clear();for(g=0;g<this._ints;++g)this._partialBlock[g]=l.getInt32(),this._partialOutput.putInt32(this._partialBlock[g]^this._outBlock[g]);if(u>0)l.read-=this.blockSize;else for(g=0;g<this._ints;++g)this._inBlock[g]=this._partialBlock[g];this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes);if(u>0&&!a)return c.putBytes(this._partialOutput.getBytes(u-
163this._partialBytes)),this._partialBytes=u,!0;c.putBytes(this._partialOutput.getBytes(b-this._partialBytes));this._partialBytes=0}};K.ofb=function(l){l=l||{};this.name="OFB";this.cipher=l.cipher;this.blockSize=l.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialOutput=y.util.createBuffer();this._partialBytes=0};K.ofb.prototype.start=function(l){if(!("iv"in l))throw Error("Invalid IV parameter.");this._iv=p(l.iv,this.blockSize);this._inBlock=
164this._iv.slice(0);this._partialBytes=0};K.ofb.prototype.encrypt=function(l,c,a){var b=l.length();if(l.length()===0)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(this._partialBytes===0&&b>=this.blockSize)for(var g=0;g<this._ints;++g)c.putInt32(l.getInt32()^this._outBlock[g]),this._inBlock[g]=this._outBlock[g];else{var u=(this.blockSize-b)%this.blockSize;u>0&&(u=this.blockSize-u);this._partialOutput.clear();for(g=0;g<this._ints;++g)this._partialOutput.putInt32(l.getInt32()^this._outBlock[g]);
165if(u>0)l.read-=this.blockSize;else for(g=0;g<this._ints;++g)this._inBlock[g]=this._outBlock[g];this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes);if(u>0&&!a)return c.putBytes(this._partialOutput.getBytes(u-this._partialBytes)),this._partialBytes=u,!0;c.putBytes(this._partialOutput.getBytes(b-this._partialBytes));this._partialBytes=0}};K.ofb.prototype.decrypt=K.ofb.prototype.encrypt;K.ctr=function(l){l=l||{};this.name="CTR";this.cipher=l.cipher;this.blockSize=l.blockSize||16;this._ints=
166this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialOutput=y.util.createBuffer();this._partialBytes=0};K.ctr.prototype.start=function(l){if(!("iv"in l))throw Error("Invalid IV parameter.");this._iv=p(l.iv,this.blockSize);this._inBlock=this._iv.slice(0);this._partialBytes=0};K.ctr.prototype.encrypt=function(l,c,a){var b=l.length();if(b===0)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(this._partialBytes===0&&b>=this.blockSize)for(var g=0;g<this._ints;++g)c.putInt32(l.getInt32()^
167this._outBlock[g]);else{var u=(this.blockSize-b)%this.blockSize;u>0&&(u=this.blockSize-u);this._partialOutput.clear();for(g=0;g<this._ints;++g)this._partialOutput.putInt32(l.getInt32()^this._outBlock[g]);u>0&&(l.read-=this.blockSize);this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes);if(u>0&&!a)return c.putBytes(this._partialOutput.getBytes(u-this._partialBytes)),this._partialBytes=u,!0;c.putBytes(this._partialOutput.getBytes(b-this._partialBytes));this._partialBytes=0}E(this._inBlock)};
168K.ctr.prototype.decrypt=K.ctr.prototype.encrypt;K.gcm=function(l){l=l||{};this.name="GCM";this.cipher=l.cipher;this.blockSize=l.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);this._outBlock=Array(this._ints);this._partialOutput=y.util.createBuffer();this._partialBytes=0;this._R=3774873600};K.gcm.prototype.start=function(l){if(!("iv"in l))throw Error("Invalid IV parameter.");var c=y.util.createBuffer(l.iv);this._cipherLength=0;var a="additionalData"in l?y.util.createBuffer(l.additionalData):
169y.util.createBuffer();this._tagLength="tagLength"in l?l.tagLength:128;this._tag=null;if(l.decrypt&&(this._tag=y.util.createBuffer(l.tag).getBytes(),this._tag.length!==this._tagLength/8))throw Error("Authentication tag does not match tag length.");this._hashBlock=Array(this._ints);this.tag=null;this._hashSubkey=Array(this._ints);this.cipher.encrypt([0,0,0,0],this._hashSubkey);this.componentBits=4;this._m=this.generateHashTable(this._hashSubkey,this.componentBits);l=c.length();if(l===12)this._j0=[c.getInt32(),
170c.getInt32(),c.getInt32(),1];else{for(this._j0=[0,0,0,0];c.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[c.getInt32(),c.getInt32(),c.getInt32(),c.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(O(l*8)))}this._inBlock=this._j0.slice(0);E(this._inBlock);this._partialBytes=0;a=y.util.createBuffer(a);this._aDataLength=O(a.length()*8);(c=a.length()%this.blockSize)&&a.fillWithByte(0,this.blockSize-c);for(this._s=[0,0,0,0];a.length()>0;)this._s=this.ghash(this._hashSubkey,
171this._s,[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()])};K.gcm.prototype.encrypt=function(l,c,a){var b=l.length();if(b===0)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(this._partialBytes===0&&b>=this.blockSize){for(var g=0;g<this._ints;++g)c.putInt32(this._outBlock[g]^=l.getInt32());this._cipherLength+=this.blockSize}else{var u=(this.blockSize-b)%this.blockSize;u>0&&(u=this.blockSize-u);this._partialOutput.clear();for(g=0;g<this._ints;++g)this._partialOutput.putInt32(l.getInt32()^
172this._outBlock[g]);if(u<=0||a){a?(g=b%this.blockSize,this._cipherLength+=g,this._partialOutput.truncate(this.blockSize-g)):this._cipherLength+=this.blockSize;for(g=0;g<this._ints;++g)this._outBlock[g]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes);if(u>0&&!a)return l.read-=this.blockSize,c.putBytes(this._partialOutput.getBytes(u-this._partialBytes)),this._partialBytes=u,!0;c.putBytes(this._partialOutput.getBytes(b-
173this._partialBytes));this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock);E(this._inBlock)};K.gcm.prototype.decrypt=function(l,c,a){var b=l.length();if(b<this.blockSize&&!(a&&b>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock);E(this._inBlock);this._hashBlock[0]=l.getInt32();this._hashBlock[1]=l.getInt32();this._hashBlock[2]=l.getInt32();this._hashBlock[3]=l.getInt32();this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(l=0;l<this._ints;++l)c.putInt32(this._outBlock[l]^
174this._hashBlock[l]);this._cipherLength=b<this.blockSize?this._cipherLength+b%this.blockSize:this._cipherLength+this.blockSize};K.gcm.prototype.afterFinish=function(l,c){var a=!0;c.decrypt&&c.overflow&&l.truncate(this.blockSize-c.overflow);this.tag=y.util.createBuffer();l=this._aDataLength.concat(O(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,l);l=[];this.cipher.encrypt(this._j0,l);for(var b=0;b<this._ints;++b)this.tag.putInt32(this._s[b]^l[b]);this.tag.truncate(this.tag.length()%
175(this._tagLength/8));c.decrypt&&this.tag.bytes()!==this._tag&&(a=!1);return a};K.gcm.prototype.multiply=function(l,c){var a=[0,0,0,0];c=c.slice(0);for(var b=0;b<128;++b)l[b/32|0]&1<<31-b%32&&(a[0]^=c[0],a[1]^=c[1],a[2]^=c[2],a[3]^=c[3]),this.pow(c,c);return a};K.gcm.prototype.pow=function(l,c){for(var a=l[3]&1,b=3;b>0;--b)c[b]=l[b]>>>1|(l[b-1]&1)<<31;c[0]=l[0]>>>1;a&&(c[0]^=this._R)};K.gcm.prototype.tableMultiply=function(l){for(var c=[0,0,0,0],a=0;a<32;++a){var b=this._m[a][l[a/8|0]>>>(7-a%8)*4&
17615];c[0]^=b[0];c[1]^=b[1];c[2]^=b[2];c[3]^=b[3]}return c};K.gcm.prototype.ghash=function(l,c,a){c[0]^=a[0];c[1]^=a[1];c[2]^=a[2];c[3]^=a[3];return this.tableMultiply(c)};K.gcm.prototype.generateHashTable=function(l,c){var a=8/c,b=4*a;a*=16;for(var g=Array(a),u=0;u<a;++u){var G=[0,0,0,0];G[u/b|0]=1<<c-1<<(b-1-u%b)*c;g[u]=this.generateSubHashTable(this.multiply(G,l),c)}return g};K.gcm.prototype.generateSubHashTable=function(l,c){c=1<<c;var a=c>>>1,b=Array(c);b[a]=l.slice(0);for(var g=a>>>1;g>0;)this.pow(b[2*
177g],b[g]=[]),g>>=1;for(g=2;g<a;){for(var u=1;u<g;++u){var G=b[g],h=b[u];b[g+u]=[G[0]^h[0],G[1]^h[1],G[2]^h[2],G[3]^h[3]]}g*=2}b[0]=[0,0,0,0];for(g=a+1;g<c;++g)u=b[g^a],b[g]=[l[0]^u[0],l[1]^u[1],l[2]^u[2],l[3]^u[3]];return b}},
177"./lib/des.js":function(K,r,C){function p(B,t){y.cipher.registerAlgorithm(B,function(){return new y.des.Algorithm(B,t)})}function E(B,t,d,q){var A=B.length===32?3:9;q=A===3?q?[30,-2,-2]:[0,32,2]:q?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var D=t[0],J=t[1];t=(D>>>
1784^J)&252645135;J^=t;D^=t<<4;t=(D>>>16^J)&65535;J^=t;D^=t<<16;t=(J>>>2^D)&858993459;D^=t;J^=t<<2;t=(J>>>8^D)&16711935;D^=t;J^=t<<8;t=(D>>>1^J)&1431655765;J^=t;D^=t<<1;D=D<<1|D>>>31;J=J<<1|J>>>31;for(var k=0;k<A;k+=3){for(var w=q[k+1],f=q[k+2],e=q[k];e!=w;e+=f){var m=J^B[e],x=(J>>>4|J<<28)^B[e+1];t=D;D=J;J=t^(c[m>>>24&63]|b[m>>>16&63]|u[m>>>8&63]|h[m&63]|l[x>>>24&63]|a[x>>>16&63]|g[x>>>8&63]|G[x&63])}t=D;D=J;J=t}D=D>>>1|D<<31;J=J>>>1|J<<31;t=(D>>>1^J)&1431655765;J^=t;D^=t<<1;t=(J>>>8^D)&16711935;D^=
179t;J^=t<<8;t=(J>>>2^D)&858993459;D^=t;J^=t<<2;t=(D>>>16^J)&65535;J^=t;D^=t<<16;t=(D>>>4^J)&252645135;d[0]=D^t<<4;d[1]=J^t}function O(B){B=B||{};var t="DES-"+(B.mode||"CBC").toUpperCase();var d=B.decrypt?y.cipher.createDecipher(t,B.key):y.cipher.createCipher(t,B.key);var q=d.start;d.start=function(A,D){var J=null;D instanceof y.util.ByteBuffer&&(J=D,D={});D=D||{};D.output=J;D.iv=A;q.call(d,D)};return d}var y=C("./lib/forge.js");C("./lib/cipher.js");C("./lib/cipherModes.js");C("./lib/util.js");K.exports=
180y.des=y.des||{};y.des.startEncrypting=function(B,t,d,q){B=O({key:B,output:d,decrypt:!1,mode:q||(t===null?"ECB":"CBC")});B.start(t);return B};y.des.createEncryptionCipher=function(B,t){return O({key:B,output:null,decrypt:!1,mode:t})};y.des.startDecrypting=function(B,t,d,q){B=O({key:B,output:d,decrypt:!0,mode:q||(t===null?"ECB":"CBC")});B.start(t);return B};y.des.createDecryptionCipher=function(B,t){return O({key:B,output:null,decrypt:!0,mode:t})};y.des.Algorithm=function(B,t){var d=this;d.name=B;d.mode=
181new t({blockSize:8,cipher:{encrypt:function(q,A){return E(d._keys,q,A,!1)},decrypt:function(q,A){return E(d._keys,q,A,!0)}}});d._init=!1};y.des.Algorithm.prototype.initialize=function(B){if(!this._init){B=y.util.createBuffer(B.key);if(this.name.indexOf("3DES")===0&&B.length()!==24)throw Error("Invalid Triple-DES key size: "+B.length()*8);for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],d=[0,1,1048576,1048577,67108864,67108865,
18268157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],q=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],A=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],D=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],J=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,
18333555488],k=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],w=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],e=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],m=[0,32,0,32,1048576,
1841048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],x=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],H=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],L=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],P=B.length()>8?3:1,Q=[],S=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],V=0,v,I=0;I<P;I++){var F=B.getInt32(),M=B.getInt32();
185v=(F>>>4^M)&252645135;M^=v;F^=v<<4;v=(M>>>-16^F)&65535;F^=v;M^=v<<-16;v=(F>>>2^M)&858993459;M^=v;F^=v<<2;v=(M>>>-16^F)&65535;F^=v;M^=v<<-16;v=(F>>>1^M)&1431655765;M^=v;F^=v<<1;v=(M>>>8^F)&16711935;F^=v;M^=v<<8;v=(F>>>1^M)&1431655765;M^=v;F^=v<<1;v=F<<8|M>>>20&240;F=M<<24|M<<8&16711680|M>>>8&65280|M>>>24&240;M=v;for(var N=0;N<S.length;++N){S[N]?(F=F<<2|F>>>26,M=M<<2|M>>>26):(F=F<<1|F>>>27,M=M<<1|M>>>27);F&=-15;M&=-15;var z=t[F>>>28]|d[F>>>24&15]|q[F>>>20&15]|A[F>>>16&15]|D[F>>>12&15]|J[F>>>8&15]|k[F>>>
1864&15],n=w[M>>>28]|f[M>>>24&15]|e[M>>>20&15]|m[M>>>16&15]|x[M>>>12&15]|H[M>>>8&15]|L[M>>>4&15];v=(n>>>16^z)&65535;Q[V++]=z^v;Q[V++]=n^v<<16}}this._keys=Q;this._init=!0}};p("DES-ECB",y.cipher.modes.ecb);p("DES-CBC",y.cipher.modes.cbc);p("DES-CFB",y.cipher.modes.cfb);p("DES-OFB",y.cipher.modes.ofb);p("DES-CTR",y.cipher.modes.ctr);p("3DES-ECB",y.cipher.modes.ecb);p("3DES-CBC",y.cipher.modes.cbc);p("3DES-CFB",y.cipher.modes.cfb);p("3DES-OFB",y.cipher.modes.ofb);p("3DES-CTR",y.cipher.modes.ctr);var l=[16843776,
1870,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],c=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,
188-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],
189a=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],b=[8396801,8321,8321,
190128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],g=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,
1911073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],u=[536870928,541065216,16384,541081616,54106
1915216,16,541081616,
1924194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],G=[2097152,69206018,67110914,0,2048,67110914,
1932099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,
194268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696]},
194"./lib/ed25519.js":function(K,r,C){function p(N){var z=N.message;if(z instanceof
195Uint8Array||z instanceof H)return z;var n=N.encoding;if(z===void 0)if(N.md)z=N.md.digest().getBytes(),n="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof z==="string"&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof z==="string"){if(typeof Buffer!=="undefined")return Buffer.from(z,n);z=new x(z,n)}else if(!(z instanceof x))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');
196N=new H(z.length());for(n=0;n<N.length;++n)N[n]=z.at(n);return N}function E(N,z){var n=w.md.sha512.create();N=new x(N);n.update(N.getBytes(z),"binary");z=n.digest().getBytes();if(typeof Buffer!=="undefined")return Buffer.from(z,"binary");n=new H(L.constants.HASH_BYTE_LENGTH);for(N=0;N<64;++N)n[N]=z.charCodeAt(N);return n}function O(N,z,n,R){var U=new H(32),T=[A(),A(),A(),A()],Y=[A(),A(),A(),A()];if(n<64)return-1;var W=A();var X=A();var ba=A(),Z=A(),ca=A(),aa=A(),ha=A();t(Y[2],Q);var da=Y[1],ea;for(ea=
1970;ea<16;++ea)da[ea]=R[2*ea]+(R[2*ea+1]<<8);da[15]&=32767;da=Y[1];k(ba,da,da);k(Z,ba,S);J(ba,ba,Y[2]);D(Z,Y[2],Z);k(ca,Z,Z);k(aa,ca,ca);k(ha,aa,ca);k(W,ha,ba);k(W,W,Z);ca=A();for(aa=0;aa<16;++aa)ca[aa]=W[aa];for(aa=250;aa>=0;--aa)k(ca,ca,ca),aa!==1&&k(ca,ca,W);for(aa=0;aa<16;++aa)W[aa]=ca[aa];k(W,W,ba);k(W,W,Z);k(W,W,Z);k(Y[0],W,Z);W=Y[0];k(X,W,W);k(X,X,Z);g(X,ba)&&k(Y[0],Y[0],M);W=Y[0];k(X,W,W);k(X,X,Z);g(X,ba)?X=-1:(G(Y[0])===R[31]>>7&&J(Y[0],P,Y[0]),k(Y[3],Y[0],Y[1]),X=0);if(X)return-1;a:{for(X=
19831;X>=0;--X){if(z[32+X]<F[X]){X=!0;break a}if(z[32+X]>F[X]){X=!1;break a}}X=!1}if(!X)return-1;for(X=0;X<n;++X)N[X]=z[X];for(X=0;X<32;++X)N[X+32]=R[X];R=E(N,n);l(R);h(T,Y,R);B(Y,z.subarray(32));c(T,Y);a(U,T);n-=64;if(u(z,0,U,0,32)){for(X=0;X<n;++X)N[X]=0;return-1}for(X=0;X<n;++X)N[X]=z[X+64];return n}function y(N,z){var n,R;for(n=63;n>=32;--n){var U=0;var T=n-32;for(R=n-12;T<R;++T)z[T]+=U-16*z[n]*F[T-(n-32)],U=z[T]+128>>8,z[T]-=U*256;z[T]+=U;z[n]=0}for(T=U=0;T<32;++T)z[T]+=U-(z[31]>>4)*F[T],U=z[T]>>
1998,z[T]&=255;for(T=0;T<32;++T)z[T]-=U*F[T];for(n=0;n<32;++n)z[n+1]+=z[n]>>8,N[n]=z[n]&255}function l(N){for(var z=new Float64Array(64),n=0;n<64;++n)z[n]=N[n],N[n]=0;y(N,z)}function c(N,z){var n=A(),R=A(),U=A(),T=A(),Y=A(),W=A(),X=A(),ba=A(),Z=A();J(n,N[1],N[0]);J(Z,z[1],z[0]);k(n,n,Z);D(R,N[0],N[1]);D(Z,z[0],z[1]);k(R,R,Z);k(U,N[3],z[3]);k(U,U,V);k(T,N[2],z[2]);D(T,T,T);J(Y,R,n);J(W,T,U);D(X,T,U);D(ba,R,n);k(N[0],Y,W);k(N[1],ba,X);k(N[2],X,W);k(N[3],Y,ba)}function a(N,z){var n=A(),R=A(),U=A(),T=z[2],
200Y=A(),W;for(W=0;W<16;++W)Y[W]=T[W];for(W=253;W>=0;--W)k(Y,Y,Y),W!==2&&W!==4&&k(Y,Y,T);for(W=0;W<16;++W)U[W]=Y[W];k(n,z[0],U);k(R,z[1],U);b(N,R);N[31]^=G(n)<<7}function b(N,z){var n,R=A(),U=A();for(n=0;n<16;++n)U[n]=z[n];d(U);d(U);d(U);for(z=0;z<2;++z){R[0]=U[0]-65517;for(n=1;n<15;++n)R[n]=U[n]-65535-(R[n-1]>>16&1),R[n-1]&=65535;R[15]=U[15]-32767-(R[14]>>16&1);n=R[15]>>16&1;R[14]&=65535;q(U,R,1-n)}for(n=0;n<16;n++)N[2*n]=U[n]&255,N[2*n+1]=U[n]>>8}function g(N,z){var n=new H(32),R=new H(32);b(n,N);
201b(R,z);return u(n,0,R,0,32)}function u(N,z,n,R,U){var T,Y=0;for(T=0;T<U;++T)Y|=N[z+T]^n[R+T];return(1&Y-1>>>8)-1}function G(N){var z=new H(32);b(z,N);return z[0]&1}function h(N,z,n){var R;t(N[0],P);t(N[1],Q);t(N[2],Q);t(N[3],P);for(R=255;R>=0;--R){var U=n[R/8|0]>>(R&7)&1;for(var T=N,Y=z,W=U,X=0;X<4;++X)q(T[X],Y[X],W);c(z,N);c(N,N);T=N;Y=z;for(W=0;W<4;++W)q(T[W],Y[W],U)}}function B(N,z){var n=[A(),A(),A(),A()];t(n[0],v);t(n[1],I);t(n[2],Q);k(n[3],v,I);h(N,n,z)}function t(N,z){var n;for(n=0;n<16;n++)N[n]=
202z[n]|0}function d(N){var z,n=1;for(z=0;z<16;++z){var R=N[z]+n+65535;n=Math.floor(R/65536);N[z]=R-n*65536}N[0]+=n-1+37*(n-1)}function q(N,z,n){for(var R=~(n-1),U=0;U<16;++U)n=R&(N[U]^z[U]),N[U]^=n,z[U]^=n}function A(N){var z,n=new Float64Array(16);if(N)for(z=0;z<N.length;++z)n[z]=N[z];return n}function D(N,z,n){for(var R=0;R<16;++R)N[R]=z[R]+n[R]}function J(N,z,n){for(var R=0;R<16;++R)N[R]=z[R]-n[R]}function k(N,z,n){var R=n[0],U=n[1],T=n[2],Y=n[3],W=n[4],X=n[5],ba=n[6],Z=n[7],ca=n[8],aa=n[9],ha=n[10],
203da=n[11],ea=n[12],ma=n[13],na=n[14],oa=n[15];n=z[0];var Ha=n*R;var Fa=n*U;var Da=n*T;var Ba=n*Y;var za=n*W;var xa=n*X;var va=n*ba;var ta=n*Z;var ra=n*ca;var qa=n*aa;var pa=n*ha;var la=n*da;var ja=n*ea;var ia=n*ma;var fa=n*na;var ka=n*oa;n=z[1];Fa+=n*R;Da+=n*U;Ba+=n*T;za+=n*Y;xa+=n*W;va+=n*X;ta+=n*ba;ra+=n*Z;qa+=n*ca;pa+=n*aa;la+=n*ha;ja+=n*da;ia+=n*ea;fa+=n*ma;ka+=n*na;var sa=n*oa;n=z[2];Da+=n*R;Ba+=n*U;za+=n*T;xa+=n*Y;va+=n*W;ta+=n*X;ra+=n*ba;qa+=n*Z;pa+=n*ca;la+=n*aa;ja+=n*ha;ia+=n*da;fa+=n*ea;
204ka+=n*ma;sa+=n*na;var ua=n*oa;n=z[3];Ba+=n*R;za+=n*U;xa+=n*T;va+=n*Y;ta+=n*W;ra+=n*X;qa+=n*ba;pa+=n*Z;la+=n*ca;ja+=n*aa;ia+=n*ha;fa+=n*da;ka+=n*ea;sa+=n*ma;ua+=n*na;var wa=n*oa;n=z[4];za+=n*R;xa+=n*U;va+=n*T;ta+=n*Y;ra+=n*W;qa+=n*X;pa+=n*ba;la+=n*Z;ja+=n*ca;ia+=n*aa;fa+=n*ha;ka+=n*da;sa+=n*ea;ua+=n*ma;wa+=n*na;var ya=n*oa;n=z[5];xa+=n*R;va+=n*U;ta+=n*T;ra+=n*Y;qa+=n*W;pa+=n*X;la+=n*ba;ja+=n*Z;ia+=n*ca;fa+=n*aa;ka+=n*ha;sa+=n*da;ua+=n*ea;wa+=n*ma;ya+=n*na;var Aa=n*oa;n=z[6];va+=n*R;ta+=n*U;ra+=n*T;
205qa+=n*Y;pa+=n*W;la+=n*X;ja+=n*ba;ia+=n*Z;fa+=n*ca;ka+=n*aa;sa+=n*ha;ua+=n*da;wa+=n*ea;ya+=n*ma;Aa+=n*na;var Ca=n*oa;n=z[7];ta+=n*R;ra+=n*U;qa+=n*T;pa+=n*Y;la+=n*W;ja+=n*X;ia+=n*ba;fa+=n*Z;ka+=n*ca;sa+=n*aa;ua+=n*ha;wa+=n*da;ya+=n*ea;Aa+=n*ma;Ca+=n*na;var Ea=n*oa;n=z[8];ra+=n*R;qa+=n*U;pa+=n*T;la+=n*Y;ja+=n*W;ia+=n*X;fa+=n*ba;ka+=n*Z;sa+=n*ca;ua+=n*aa;wa+=n*ha;ya+=n*da;Aa+=n*ea;Ca+=n*ma;Ea+=n*na;var Ga=n*oa;n=z[9];qa+=n*R;pa+=n*U;la+=n*T;ja+=n*Y;ia+=n*W;fa+=n*X;ka+=n*ba;sa+=n*Z;ua+=n*ca;wa+=n*aa;ya+=
206n*ha;Aa+=n*da;Ca+=n*ea;Ea+=n*ma;Ga+=n*na;var Ia=n*oa;n=z[10];pa+=n*R;la+=n*U;ja+=n*T;ia+=n*Y;fa+=n*W;ka+=n*X;sa+=n*ba;ua+=n*Z;wa+=n*ca;ya+=n*aa;Aa+=n*ha;Ca+=n*da;Ea+=n*ea;Ga+=n*ma;Ia+=n*na;var Ja=n*oa;n=z[11];la+=n*R;ja+=n*U;ia+=n*T;fa+=n*Y;ka+=n*W;sa+=n*X;ua+=n*ba;wa+=n*Z;ya+=n*ca;Aa+=n*aa;Ca+=n*ha;Ea+=n*da;Ga+=n*ea;Ia+=n*ma;Ja+=n*na;var Ka=n*oa;n=z[12];ja+=n*R;ia+=n*U;fa+=n*T;ka+=n*Y;sa+=n*W;ua+=n*X;wa+=n*ba;ya+=n*Z;Aa+=n*ca;Ca+=n*aa;Ea+=n*ha;Ga+=n*da;Ia+=n*ea;Ja+=n*ma;Ka+=n*na;var La=n*oa;n=z[13];
207ia+=n*R;fa+=n*U;ka+=n*T;sa+=n*Y;ua+=n*W;wa+=n*X;ya+=n*ba;Aa+=n*Z;Ca+=n*ca;Ea+=n*aa;Ga+=n*ha;Ia+=n*da;Ja+=n*ea;Ka+=n*ma;La+=n*na;var Ma=n*oa;n=z[14];fa+=n*R;ka+=n*U;sa+=n*T;ua+=n*Y;wa+=n*W;ya+=n*X;Aa+=n*ba;Ca+=n*Z;Ea+=n*ca;Ga+=n*aa;Ia+=n*ha;Ja+=n*da;Ka+=n*ea;La+=n*ma;Ma+=n*na;var Na=n*oa;n=z[15];ka+=n*R;Fa+=38*(ua+n*T);Da+=38*(wa+n*Y);Ba+=38*(ya+n*W);za+=38*(Aa+n*X);xa+=38*(Ca+n*ba);va+=38*(Ea+n*Z);ta+=38*(Ga+n*ca);ra+=38*(Ia+n*aa);qa+=38*(Ja+n*ha);pa+=38*(Ka+n*da);la+=38*(La+n*ea);ja+=38*(Ma+n*ma);
208ia+=38*(Na+n*na);fa+=n*oa*38;n=Ha+38*(sa+n*U)+1+65535;
208z=Math.floor(n/65536);Ha=n-z*65536;n=Fa+z+65535;z=Math.floor(n/65536);Fa=n-z*65536;n=Da+z+65535;z=Math.floor(n/65536);Da=n-z*65536;n=Ba+z+65535;z=Math.floor(n/65536);Ba=n-z*65536;n=za+z+65535;z=Math.floor(n/65536);za=n-z*65536;n=xa+z+65535;z=Math.floor(n/65536);xa=n-z*65536;n=va+z+65535;z=Math.floor(n/65536);va=n-z*65536;n=ta+z+65535;z=Math.floor(n/65536);ta=n-z*65536;n=ra+z+65535;z=Math.floor(n/65536);ra=n-z*65536;n=qa+z+65535;z=Math.floor(n/
20965536);qa=n-z*65536;n=pa+z+65535;z=Math.floor(n/65536);pa=n-z*65536;n=la+z+65535;z=Math.floor(n/65536);la=n-z*65536;n=ja+z+65535;z=Math.floor(n/65536);ja=n-z*65536;n=ia+z+65535;z=Math.floor(n/65536);ia=n-z*65536;n=fa+z+65535;z=Math.floor(n/65536);fa=n-z*65536;n=ka+z+65535;z=Math.floor(n/65536);ka=n-z*65536;Ha+=z-1+37*(z-1);n=Ha+1+65535;z=Math.floor(n/65536);Ha=n-z*65536;n=Fa+z+65535;z=Math.floor(n/65536);Fa=n-z*65536;n=Da+z+65535;z=Math.floor(n/65536);Da=n-z*65536;n=Ba+z+65535;z=Math.floor(n/65536);
210Ba=n-z*65536;n=za+z+65535;z=Math.floor(n/65536);za=n-z*65536;n=xa+z+65535;z=Math.floor(n/65536);xa=n-z*65536;n=va+z+65535;z=Math.floor(n/65536);va=n-z*65536;n=ta+z+65535;z=Math.floor(n/65536);ta=n-z*65536;n=ra+z+65535;z=Math.floor(n/65536);ra=n-z*65536;n=qa+z+65535;z=Math.floor(n/65536);qa=n-z*65536;n=pa+z+65535;z=Math.floor(n/65536);pa=n-z*65536;n=la+z+65535;z=Math.floor(n/65536);la=n-z*65536;n=ja+z+65535;z=Math.floor(n/65536);ja=n-z*65536;n=ia+z+65535;z=Math.floor(n/65536);ia=n-z*65536;n=fa+z+65535;
211z=Math.floor(n/65536);fa=n-z*65536;n=ka+z+65535;z=Math.floor(n/65536);N[0]=Ha+(z-1+37*(z-1));N[1]=Fa;N[2]=Da;N[3]=Ba;N[4]=za;N[5]=xa;N[6]=va;N[7]=ta;N[8]=ra;N[9]=qa;N[10]=pa;N[11]=la;N[12]=ja;N[13]=ia;N[14]=fa;N[15]=n-z*65536}var w=C("./lib/forge.js");C("./lib/jsbn.js");C("./lib/random.js");C("./lib/sha512.js");C("./lib/util.js");r=C("./lib/asn1-validator.js");var f=r.publicKeyValidator,e=r.privateKeyValidator;if(typeof m==="undefined")var m=w.jsbn.BigInteger;var x=w.util.ByteBuffer,H=typeof Buffer===
212"undefined"?Uint8Array:Buffer;w.pki=w.pki||{};K.exports=w.pki.ed25519=w.ed25519=w.ed25519||{};var L=w.ed25519;L.constants={};L.constants.PUBLIC_KEY_BYTE_LENGTH=32;L.constants.PRIVATE_KEY_BYTE_LENGTH=64;L.constants.SEED_BYTE_LENGTH=32;L.constants.SIGN_BYTE_LENGTH=64;L.constants.HASH_BYTE_LENGTH=64;L.generateKeyPair=function(N){N=N||{};var z=N.seed;if(z===void 0)z=w.random.getBytesSync(L.constants.SEED_BYTE_LENGTH);else if(typeof z==="string"){if(z.length!==L.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+
213L.constants.SEED_BYTE_LENGTH+" bytes in length.");}else if(!(z instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');z=p({message:z,encoding:"binary"});N=new H(L.constants.PUBLIC_KEY_BYTE_LENGTH);for(var n=new H(L.constants.PRIVATE_KEY_BYTE_LENGTH),R=0;R<32;++R)n[R]=z[R];z=[A(),A(),A(),A()];R=E(n,32);R[0]&=248;R[31]&=127;R[31]|=64;B(z,R);a(N,z);for(z=0;z<32;++z)n[z+32]=N[z];return{publicKey:N,privateKey:n}};L.privateKeyFromAsn1=function(N){var z=
214{},n=[];if(!w.asn1.validate(N,e,z,n))throw z=Error("Invalid Key."),z.errors=n,z;n=w.asn1.derToOid(z.privateKeyOid);N=w.oids.EdDSA25519;if(n!==N)throw Error('Invalid OID "'+n+'"; OID must be "'+N+'".');return{privateKeyBytes:p({message:w.asn1.fromDer(z.privateKey).value,encoding:"binary"})}};L.publicKeyFromAsn1=function(N){var z={},n=[];if(!w.asn1.validate(N,f,z,n))throw z=Error("Invalid Key."),z.errors=n,z;n=w.asn1.derToOid(z.publicKeyOid);N=w.oids.EdDSA25519;if(n!==N)throw Error('Invalid OID "'+
215n+'"; OID must be "'+N+'".');z=z.ed25519PublicKey;if(z.length!==L.constants.PUBLIC_KEY_BYTE_LENGTH)throw Error("Key length is invalid.");return p({message:z,encoding:"binary"})};L.publicKeyFromPrivateKey=function(N){N=N||{};N=p({message:N.privateKey,encoding:"binary"});if(N.length!==L.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+L.constants.PRIVATE_KEY_BYTE_LENGTH);for(var z=new H(L.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<z.length;++n)z[n]=
216N[32+n];return z};L.sign=function(N){N=N||{};var z=p(N),n=p({message:N.privateKey,encoding:"binary"});if(n.length===L.constants.SEED_BYTE_LENGTH)n=L.generateKeyPair({seed:n}).privateKey;else if(n.length!==L.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+L.constants.SEED_BYTE_LENGTH+" or "+L.constants.PRIVATE_KEY_BYTE_LENGTH);N=new H(L.constants.SIGN_BYTE_LENGTH+z.length);var R=z.length,U=n,T=new Float64Array(64),Y=[A(),A(),A(),A()],W=E(U,32);
217W[0]&=248;W[31]&=127;W[31]|=64;for(n=0;n<R;
217++n)N[64+n]=z[n];for(n=0;n<32;++n)N[32+n]=W[32+n];z=E(N.subarray(32),R+32);l(z);B(Y,z);a(N,Y);for(n=32;n<64;++n)N[n]=U[n];R=E(N,R+64);l(R);for(n=32;n<64;++n)T[n]=0;for(n=0;n<32;++n)T[n]=z[n];for(n=0;n<32;++n)for(z=0;z<32;z++)T[n+z]+=R[n]*W[z];y(N.subarray(32),T);n=new H(L.constants.SIGN_BYTE_LENGTH);for(T=0;T<n.length;++T)n[T]=N[T];return n};L.verify=function(N){N=N||{};var z=p(N);if(N.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');
218var n=p({message:N.signature,encoding:"binary"});if(n.length!==L.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+L.constants.SIGN_BYTE_LENGTH);N=p({message:N.publicKey,encoding:"binary"});if(N.length!==L.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+L.constants.PUBLIC_KEY_BYTE_LENGTH);var R=new H(L.constants.SIGN_BYTE_LENGTH+z.length),U=new H(L.constants.SIGN_BYTE_LENGTH+z.length),T;for(T=0;T<
219L.constants.SIGN_BYTE_LENGTH;++T)R[T]=n[T];for(T=0;T<z.length;++T)R[T+L.constants.SIGN_BYTE_LENGTH]=z[T];return O(U,R,R.length,N)>=0};var P=A(),Q=A([1]),S=A([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),V=A([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=A([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),I=A([26200,26214,26214,26214,26214,26214,26214,26214,
22026214,26214,26214,26214,26214,26214,26214,26214]),F=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),M=A([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139])},
220"./lib/forge.js":function(K,r){K.exports={options:{usePureJavaScript:!1}}},
220"./lib/hmac.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/md.js");C("./lib/util.js");(K.exports=p.hmac=p.hmac||{}).create=function(){var E=null,O=null,y=null,
221l={start:function(c,a){if(c!==null)if(typeof c==="string")if(c=c.toLowerCase(),c in p.md.algorithms)E=p.md.algorithms[c].create();else throw Error('Unknown hash algorithm "'+c+'"');else E=c;if(a!==null){if(typeof a==="string")a=p.util.createBuffer(a);else if(p.util.isArray(a)){c=a;a=p.util.createBuffer();for(var b=0;b<c.length;++b)a.putByte(c[b])}var g=a.length();g>E.blockLength&&(E.start(),E.update(a.bytes()),a=E.digest());O=p.util.createBuffer();y=p.util.createBuffer();g=a.length();for(b=0;b<g;++b)c=
222a.at(b),O.putByte(54^c),y.putByte(92^c);if(g<E.blockLength)for(c=E.blockLength-g,b=0;b<c;++b)O.putByte(54),y.putByte(92);O=O.bytes();y=y.bytes()}E.start();E.update(O)},update:function(c){E.update(c)},getMac:function(){var c=E.digest().bytes();E.start();E.update(y);E.update(c);return E.digest()}};l.digest=l.getMac;return l}},
222"./lib/index.js":function(K,r,C){K.exports=C("./lib/forge.js");C("./lib/aes.js");C("./lib/aesCipherSuites.js");C("./lib/asn1.js");C("./lib/cipher.js");C("./lib/des.js");C("./lib/ed25519.js");
223C("./lib/hmac.js");C("./lib/kem.js");C("./lib/log.js");C("./lib/md.all.js");C("./lib/mgf1.js");C("./lib/pbkdf2.js");C("./lib/pem.js");C("./lib/pkcs1.js");C("./lib/pkcs12.js");C("./lib/pkcs7.js");C("./lib/pki.js");C("./lib/prime.js");C("./lib/prng.js");C("./lib/pss.js");C("./lib/random.js");C("./lib/rc2.js");C("./lib/ssh.js");C("./lib/tls.js");C("./lib/util.js")},
223"./lib/jsbn.js":function(K,r,C){function p(f,e,m){this.data=[];f!=null&&("number"==typeof f?this.fromNumber(f,e,m):e==null&&"string"!=typeof f?
224this.fromString(f,256):this.fromString(f,e))}function E(){return new p(null)}function O(f,e,m,x,H,L){for(;--L>=0;){var P=e*this.data[f++]+m.data[x]+H;H=Math.floor(P/67108864);m.data[x++]=P&67108863}return H}function y(f,e,m,x,H,L){var P=e&32767;for(e>>=15;--L>=0;){var Q=this.data[f]&32767,S=this.data[f++]>>15,V=e*Q+S*P;Q=P*Q+((V&32767)<<15)+m.data[x]+(H&1073741823);H=(Q>>>30)+(V>>>15)+e*S+(H>>>30);m.data[x++]=Q&1073741823}return H}function l(f,e,m,x,H,L){var P=e&16383;for(e>>=14;--L>=0;){var Q=this.data[f]&
22516383,S=this.data[f++]>>14,V=e*Q+S*P;Q=P*Q+((V&16383)<<14)+m.data[x]+H;H=(Q>>28)+(V>>14)+e*S;m.data[x++]=Q&268435455}return H}function c(f,e){f=J[f.charCodeAt(e)];return f==null?-1:f}function a(f){var e=E();e.fromInt(f);return e}function b(f){var e=1,m;(m=f>>>16)!=0&&(f=m,e+=16);(m=f>>8)!=0&&(f=m,e+=8);(m=f>>4)!=0&&(f=m,e+=4);(m=f>>2)!=0&&(f=m,e+=2);f>>1!=0&&(e+=1);return e}function g(f){this.m=f}function u(f){this.m=f;this.mp=f.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<f.DB-
22615)-1;this.mt2=2*f.t}function G(f,e){return f&e}function h(f,e){return f|e}function B(f,e){return f^e}function t(f,e){return f&~e}function d(){}function q(f){return f}function A(f){this.r2=E();this.q3=E();p.ONE.dlShiftTo(2*f.t,this.r2);this.mu=this.r2.divide(f);this.m=f}function D(){return{nextBytes:function(f){for(var e=0;e<f.length;++e)f[e]=Math.floor(Math.random()*256)}}}r=C("./lib/forge.js");K.exports=r.jsbn=r.jsbn||{};r.jsbn.BigInteger=p;typeof navigator==="undefined"?(p.prototype.am=l,K=28):
227navigator.appName=="Microsoft Internet Explorer"?(p.prototype.am=y,K=30):navigator.appName!="Netscape"?(p.prototype.am=O,K=26):(p.prototype.am=l,K=28);p.prototype.DB=K;p.prototype.DM=(1<<K)-1;p.prototype.DV=1<<K;p.prototype.FV=4503599627370496;p.prototype.F1=52-K;p.prototype.F2=2*K-52;var J=[];K=48;for(r=0;r<=9;++r)J[K++]=r;K=97;for(r=10;r<36;++r)J[K++]=r;K=65;for(r=10;r<36;++r)J[K++]=r;g.prototype.convert=function(f){return f.s<0||f.compareTo(this.m)>=0?f.mod(this.m):f};g.prototype.revert=function(f){return f};
228g.prototype.reduce=function(f){f.divRemTo(this.m,null,f)};g.prototype.mulTo=function(f,e,m){f.multiplyTo(e,m);this.reduce(m)};g.prototype.sqrTo=function(f,e){f.squareTo(e);this.reduce(e)};u.prototype.convert=function(f){var e=E();f.abs().dlShiftTo(this.m.t,e);e.divRemTo(this.m,null,e);f.s<0&&e.compareTo(p.ZERO)>0&&this.m.subTo(e,e);return e};u.prototype.revert=function(f){var e=E();f.copyTo(e);this.reduce(e);return e};u.prototype.reduce=function(f){for(;f.t<=this.mt2;)f.data[f.t++]=0;for(var e=0;e<
229this.m.t;++e){var m=f.data[e]&32767,x=m*this.mpl+((m*this.mph+(f.data[e]>>15)*this.mpl&this.um)<<15)&f.DM;m=e+this.m.t;for(f.data[m]+=this.m.am(0,x,f,e,0,this.m.t);f.data[m]>=f.DV;)f.data[m]-=f.DV,f.data[++m]++}f.clamp();f.drShiftTo(this.m.t,f);f.compareTo(this.m)>=0&&f.subTo(this.m,f)};u.prototype.mulTo=function(f,e,m){f.multiplyTo(e,m);this.reduce(m)};u.prototype.sqrTo=function(f,e){f.squareTo(e);this.reduce(e)};p.prototype.copyTo=function(f){for(var e=this.t-1;e>=0;--e)f.data[e]=this.data[e];f.t=
230this.t;f.s=this.s};p.prototype.fromInt=function(f){this.t=1;this.s=f<0?-1:0;f>0?this.data[0]=f:f<-1?this.data[0]=f+this.DV:this.t=0};p.prototype.fromString=function(f,e){if(e==16)e=4;else if(e==8)e=3;else if(e==256)e=8;else if(e==2)e=1;else if(e==32)e=5;else if(e==4)e=2;else{this.fromRadix(f,e);return}this.s=this.t=0;for(var m=f.length,x=!1,H=0;--m>=0;){var L=e==8?f[m]&255:c(f,m);L<0?f.charAt(m)=="-"&&(x=!0):(x=!1,H==0?this.data[this.t++]=L:H+e>this.DB?(this.data[this.t-1]|=(L&(1<<this.DB-H)-1)<<
231H,this.data[this.t++]=L>>this.DB-H):this.data[this.t-1]|=L<<H,H+=e,H>=this.DB&&(H-=this.DB))}e==8&&(f[0]&128)!=0&&(this.s=-1,H>0&&(this.data[this.t-1]|=(1<<this.DB-H)-1<<H));this.clamp();x&&p.ZERO.subTo(this,this)};p.prototype.clamp=function(){for(var f=this.s&this.DM;this.t>0&&this.data[this.t-1]==f;)--this.t};p.prototype.dlShiftTo=function(f,e){var m;for(m=this.t-1;m>=0;--m)e.data[m+f]=this.data[m];for(m=f-1;m>=0;--m)e.data[m]=0;e.t=this.t+f;e.s=this.s};p.prototype.drShiftTo=function(f,e){for(var m=
232f;m<this.t;++m)e.data[m-f]=this.data[m];e.t=Math.max(this.t-f,0);e.s=this.s};p.prototype.lShiftTo=function(f,e){var m=f%this.DB,x=this.DB-m,H=(1<<x)-1;
232f=Math.floor(f/this.DB);var L=this.s<<m&this.DM,P;for(P=this.t-1;P>=0;--P)e.data[P+f+1]=this.data[P]>>x|L,L=(this.data[P]&H)<<m;for(P=f-1;P>=0;--P)e.data[P]=0;e.data[f]=L;e.t=this.t+f+1;e.s=this.s;e.clamp()};p.prototype.rShiftTo=function(f,e){e.s=this.s;var m=Math.floor(f/this.DB);if(m>=this.t)e.t=0;else{f%=this.DB;var x=this.DB-f,H=(1<<f)-1;e.data[0]=
233this.data[m]>>f;for(var L=m+1;L<this.t;++L)e.data[L-m-1]|=(this.data[L]&H)<<x,e.data[L-m]=this.data[L]>>f;f>0&&(e.data[this.t-m-1]|=(this.s&H)<<x);e.t=this.t-m;e.clamp()}};p.prototype.subTo=function(f,e){for(var m=0,x=0,H=Math.min(f.t,this.t);m<H;)x+=this.data[m]-f.data[m],e.data[m++]=x&this.DM,x>>=this.DB;if(f.t<this.t){for(x-=f.s;m<this.t;)x+=this.data[m],e.data[m++]=x&this.DM,x>>=this.DB;x+=this.s}else{for(x+=this.s;m<f.t;)x-=f.data[m],e.data[m++]=x&this.DM,x>>=this.DB;x-=f.s}e.s=x<0?-1:0;x<-1?
234e.data[m++]=this.DV+x:x>0&&(e.data[m++]=x);e.t=m;e.clamp()};p.prototype.multiplyTo=function(f,e){var m=this.abs(),x=f.abs(),H=m.t;for(e.t=H+x.t;--H>=0;)e.data[H]=0;for(H=0;H<x.t;++H)e.data[H+m.t]=m.am(0,x.data[H],e,H,0,m.t);e.s=0;e.clamp();this.s!=f.s&&p.ZERO.subTo(e,e)};p.prototype.squareTo=function(f){for(var e=this.abs(),m=f.t=2*e.t;--m>=0;)f.data[m]=0;for(m=0;m<e.t-1;++m){var x=e.am(m,e.data[m],f,2*m,0,1);(f.data[m+e.t]+=e.am(m+1,2*e.data[m],f,2*m+1,x,e.t-m-1))>=e.DV&&(f.data[m+e.t]-=e.DV,f.data[m+
235e.t+1]=1)}f.t>0&&(f.data[f.t-1]+=e.am(m,e.data[m],f,2*m,0,1));f.s=0;f.clamp()};p.prototype.divRemTo=function(f,e,m){var x=f.abs();if(!(x.t<=0)){var H=this.abs();if(H.t<x.t)e!=null&&e.fromInt(0),m!=null&&this.copyTo(m);else{m==null&&(m=E());var L=E(),P=this.s;f=f.s;var Q=this.DB-b(x.data[x.t-1]);Q>0?(x.lShiftTo(Q,L),H.lShiftTo(Q,m)):(x.copyTo(L),H.copyTo(m));x=L.t;H=L.data[x-1];if(H!=0){var S=H*(1<<this.F1)+(x>1?L.data[x-2]>>this.F2:0),V=this.FV/S;S=(1<<this.F1)/S;var v=1<<this.F2,I=m.t,F=I-x,M=e==
236null?E():e;L.dlShiftTo(F,M);m.compareTo(M)>=0&&(m.data[m.t++]=1,m.subTo(M,m));p.ONE.dlShiftTo(x,M);for(M.subTo(L,L);L.t<x;)L.data[L.t++]=0;for(;--F>=0;){var N=m.data[--I]==H?this.DM:Math.floor(m.data[I]*V+(m.data[I-1]+v)*S);if((m.data[I]+=L.am(0,N,m,F,0,x))<N)for(L.dlShiftTo(F,M),m.subTo(M,m);m.data[I]<--N;)m.subTo(M,m)}e!=null&&(m.drShiftTo(x,e),P!=f&&p.ZERO.subTo(e,e));m.t=x;m.clamp();Q>0&&m.rShiftTo(Q,m);P<0&&p.ZERO.subTo(m,m)}}}};p.prototype.invDigit=function(){if(this.t<1)return 0;var f=this.data[0];
237if((f&1)==0)return 0;var e=f&3;e=e*(2-(f&15)*e)&15;e=e*(2-(f&255)*e)&255;e=e*(2-((f&65535)*e&65535))&65535;e=e*(2-f*e%this.DV)%this.DV;return e>0?this.DV-e:-e};p.prototype.isEven=function(){return(this.t>0?this.data[0]&1:this.s)==0};p.prototype.exp=function(f,e){if(f>4294967295||f<1)return p.ONE;var m=E(),x=E(),H=e.convert(this),L=b(f)-1;for(H.copyTo(m);--L>=0;)if(e.sqrTo(m,x),(f&1<<L)>0)e.mulTo(x,H,m);else{var P=m;m=x;x=P}return e.revert(m)};p.prototype.toString=function(f){if(this.s<0)return"-"+
238this.negate().toString(f);if(f==16)f=4;else if(f==8)f=3;else if(f==2)f=1;else if(f==32)f=5;else if(f==4)f=2;else return this.toRadix(f);var e=(1<<f)-1,m,x=!1,H="",L=this.t,P=this.DB-L*this.DB%f;if(L-- >0)for(P<this.DB&&(m=this.data[L]>>P)>0&&(x=!0,H="0123456789abcdefghijklmnopqrstuvwxyz".charAt(m));L>=0;)P<f?(m=(this.data[L]&(1<<P)-1)<<f-P,m|=this.data[--L]>>(P+=this.DB-f)):(m=this.data[L]>>(P-=f)&e,P<=0&&(P+=this.DB,--L)),m>0&&(x=!0),x&&(H+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(m));return x?
239H:"0"};p.prototype.negate=function(){var f=E();p.ZERO.subTo(this,f);return f};p.prototype.abs=function(){return this.s<0?this.negate():this};p.prototype.compareTo=function(f){var e=this.s-f.s;if(e!=0)return e;var m=this.t;e=m-f.t;if(e!=0)return this.s<0?-e:e;for(;--m>=0;)if((e=this.data[m]-f.data[m])!=0)return e;return 0};p.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+b(this.data[this.t-1]^this.s&this.DM)};p.prototype.mod=function(f){var e=E();this.abs().divRemTo(f,null,e);
240this.s<0&&e.compareTo(p.ZERO)>0&&f.subTo(e,e);return e};p.prototype.modPowInt=function(f,e){e=f<256||e.isEven()?new g(e):new u(e);return this.exp(f,e)};p.ZERO=a(0);p.ONE=a(1);d.prototype.convert=q;d.prototype.revert=q;d.prototype.mulTo=function(f,e,m){f.multiplyTo(e,m)};d.prototype.sqrTo=function(f,e){f.squareTo(e)};A.prototype.convert=function(f){if(f.s<0||f.t>2*this.m.t)return f.mod(this.m);
240if(f.compareTo(this.m)<0)return f;var e=E();f.copyTo(e);this.reduce(e);return e};A.prototype.revert=function(f){return f};
241A.prototype.reduce=function(f){f.drShiftTo(this.m.t-1,this.r2);f.t>this.m.t+1&&(f.t=this.m.t+1,f.clamp());this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);f.compareTo(this.r2)<0;)f.dAddOffset(1,this.m.t+1);for(f.subTo(this.r2,f);f.compareTo(this.m)>=0;)f.subTo(this.m,f)};A.prototype.mulTo=function(f,e,m){f.multiplyTo(e,m);this.reduce(m)};A.prototype.sqrTo=function(f,e){f.squareTo(e);this.reduce(e)};var k=[2,3,5,7,11,13,17,19,23,29,31,37,41,
24243,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,
243823,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],w=67108864/k[k.length-1];p.prototype.chunkSize=function(f){return Math.floor(Math.LN2*this.DB/Math.log(f))};p.prototype.toRadix=function(f){f==null&&(f=10);if(this.signum()==0||f<2||f>36)return"0";var e=this.chunkSize(f);e=Math.pow(f,e);var m=a(e),x=E(),H=E(),L="";for(this.divRemTo(m,x,H);x.signum()>0;)L=(e+H.intValue()).toString(f).substr(1)+L,x.divRemTo(m,x,H);return H.intValue().toString(f)+
244L};p.prototype.fromRadix=function(f,e){this.fromInt(0);e==null&&(e=10);for(var m=this.chunkSize(e),x=Math.pow(e,m),H=!1,L=0,P=0,Q=0;Q<f.length;++Q){var S=c(f,Q);S<0?f.charAt(Q)=="-"&&this.signum()==0&&(H=!0):(P=e*P+S,++L>=m&&(this.dMultiply(x),this.dAddOffset(P,0),P=L=0))}L>0&&(this.dMultiply(Math.pow(e,L)),this.dAddOffset(P,0));H&&p.ZERO.subTo(this,this)};p.prototype.fromNumber=function(f,e,m){if("number"==typeof e)if(f<2)this.fromInt(1);else for(this.fromNumber(f,m),this.testBit(f-1)||this.bitwiseTo(p.ONE.shiftLeft(f-
2451),h,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>f&&this.subTo(p.ONE.shiftLeft(f-1),this);else{m=[];var x=f&7;m.length=(f>>3)+1;e.nextBytes(m);m[0]=x>0?m[0]&(1<<x)-1:0;this.fromString(m,256)}};p.prototype.bitwiseTo=function(f,e,m){var x,H=Math.min(f.t,this.t);for(x=0;x<H;++x)m.data[x]=e(this.data[x],f.data[x]);if(f.t<this.t){var L=f.s&this.DM;for(x=H;x<this.t;++x)m.data[x]=e(this.data[x],L);m.t=this.t}else{L=this.s&this.DM;for(x=H;x<f.t;++x)m.data[x]=
246e(L,f.data[x]);m.t=f.t}m.s=e(this.s,f.s);m.clamp()};p.prototype.changeBit=function(f,e){f=p.ONE.shiftLeft(f);this.bitwiseTo(f,e,f);return f};p.prototype.addTo=function(f,e){for(var m=0,x=0,H=Math.min(f.t,this.t);m<H;)x+=this.data[m]+f.data[m],e.data[m++]=x&this.DM,x>>=this.DB;if(f.t<this.t){for(x+=f.s;m<this.t;)x+=this.data[m],e.data[m++]=x&this.DM,x>>=this.DB;x+=this.s}else{for(x+=this.s;m<f.t;)x+=f.data[m],e.data[m++]=x&this.DM,x>>=this.DB;x+=f.s}e.s=x<0?-1:0;x>0?e.data[m++]=x:x<-1&&(e.data[m++]=
247this.DV+x);e.t=m;e.clamp()};p.prototype.dMultiply=function(f){this.data[this.t]=this.am(0,f-1,this,0,0,this.t);++this.t;this.clamp()};p.prototype.dAddOffset=function(f,e){if(f!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=f;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}};p.prototype.multiplyLowerTo=function(f,e,m){var x=Math.min(this.t+f.t,e);m.s=0;for(m.t=x;x>0;)m.data[--x]=0;var H;for(H=m.t-this.t;x<H;++x)m.data[x+this.t]=this.am(0,
248f.data[x],m,x,0,this.t);for(H=Math.min(f.t,e);x<H;++x)this.am(0,f.data[x],m,x,0,e-x);m.clamp()};p.prototype.multiplyUpperTo=function(f,e,m){--e;var x=m.t=this.t+f.t-e;for(m.s=0;--x>=0;)m.data[x]=0;for(x=Math.max(e-this.t,0);x<f.t;++x)m.data[this.t+x-e]=this.am(e-x,f.data[x],m,0,0,this.t+x-e);m.clamp();m.drShiftTo(1,m)};p.prototype.modInt=function(f){if(f<=0)return 0;var e=this.DV%f,m=this.s<0?f-1:0;if(this.t>0)if(e==0)m=this.data[0]%f;else for(var x=this.t-1;x>=0;--x)m=(e*m+this.data[x])%f;return m};
249p.prototype.millerRabin=function(f){var e=this.subtract(p.ONE),m=e.getLowestSetBit();if(m<=0)return!1;for(var x=e.shiftRight(m),H=D(),L,P=0;P<f;++P){do L=new p(this.bitLength(),H);while(L.compareTo(p.ONE)<=0||L.compareTo(e)>=0);L=L.modPow(x,this);
249if(L.compareTo(p.ONE)!=0&&L.compareTo(e)!=0){for(var Q=1;Q++<m&&L.compareTo(e)!=0;)if(L=L.modPowInt(2,this),L.compareTo(p.ONE)==0)return!1;if(L.compareTo(e)!=0)return!1}}return!0};p.prototype.clone=function(){var f=E();this.copyTo(f);return f};p.prototype.intValue=
250function(){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)<<this.DB|this.data[0]};p.prototype.byteValue=function(){return this.t==0?this.s:this.data[0]<<24>>24};p.prototype.shortValue=function(){return this.t==0?this.s:this.data[0]<<16>>16};p.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1};p.prototype.toByteArray=function(){var f=
251this.t,e=[];e[0]=this.s;var m=this.DB-f*this.DB%8,x,H=0;if(f-- >0)for(m<this.DB&&(x=this.data[f]>>m)!=(this.s&this.DM)>>m&&(e[H++]=x|this.s<<this.DB-m);f>=0;)if(m<8?(x=(this.data[f]&(1<<m)-1)<<8-m,x|=this.data[--f]>>(m+=this.DB-8)):(x=this.data[f]>>(m-=8)&255,m<=0&&(m+=this.DB,--f)),(x&128)!=0&&(x|=-256),H==0&&(this.s&128)!=(x&128)&&++H,H>0||x!=this.s)e[H++]=x;return e};p.prototype.equals=function(f){return this.compareTo(f)==0};p.prototype.min=function(f){return this.compareTo(f)<0?this:f};p.prototype.max=
252function(f){return this.compareTo(f)>0?this:f};p.prototype.and=function(f){var e=E();this.bitwiseTo(f,G,e);return e};p.prototype.or=function(f){var e=E();this.bitwiseTo(f,h,e);return e};p.prototype.xor=function(f){var e=E();this.bitwiseTo(f,B,e);return e};p.prototype.andNot=function(f){var e=E();this.bitwiseTo(f,t,e);return e};p.prototype.not=function(){for(var f=E(),e=0;e<this.t;++e)f.data[e]=this.DM&~this.data[e];f.t=this.t;f.s=~this.s;return f};p.prototype.shiftLeft=function(f){var e=E();f<0?this.rShiftTo(-f,
253e):this.lShiftTo(f,e);return e};p.prototype.shiftRight=function(f){var e=E();f<0?this.lShiftTo(-f,e):this.rShiftTo(f,e);return e};p.prototype.getLowestSetBit=function(){for(var f=0;f<this.t;++f)if(this.data[f]!=0){var e=f*this.DB;f=this.data[f];if(f==0)f=-1;else{var m=0;(f&65535)==0&&(f>>=16,m+=16);(f&255)==0&&(f>>=8,m+=8);(f&15)==0&&(f>>=4,m+=4);(f&3)==0&&(f>>=2,m+=2);(f&1)==0&&++m;f=m}return e+f}return this.s<0?this.t*this.DB:-1};p.prototype.bitCount=function(){for(var f=0,e=this.s&this.DM,m=0;m<
254this.t;++m){for(var x=this.data[m]^e,H=0;x!=0;)x&=x-1,++H;f+=H}return f};p.prototype.testBit=function(f){var e=Math.floor(f/this.DB);return e>=this.t?this.s!=0:(this.data[e]&1<<f%this.DB)!=0};p.prototype.setBit=function(f){return this.changeBit(f,h)};p.prototype.clearBit=function(f){return this.changeBit(f,t)};p.prototype.flipBit=function(f){return this.changeBit(f,B)};p.prototype.add=function(f){var e=E();this.addTo(f,e);return e};p.prototype.subtract=function(f){var e=E();this.subTo(f,e);return e};
255p.prototype.multiply=function(f){var e=E();this.multiplyTo(f,e);return e};p.prototype.divide=function(f){var e=E();this.divRemTo(f,e,null);return e};p.prototype.remainder=function(f){var e=E();this.divRemTo(f,null,e);return e};p.prototype.divideAndRemainder=function(f){var e=E(),m=E();this.divRemTo(f,e,m);return[e,m]};p.prototype.modPow=function(f,e){var m=f.bitLength(),x=a(1);if(m<=0)return x;var H=m<18?1:m<48?3:m<144?4:m<768?5:6;e=m<8?new g(e):e.isEven()?new A(e):new u(e);var L=[],P=3,Q=H-1,S=(1<<
256H)-1;L[1]=e.convert(this);if(H>1)for(m=E(),e.sqrTo(L[1],m);P<=S;)L[P]=E(),e.mulTo(m,L[P-2],L[P]),P+=2;var V=f.t-1,v=!0,I=E();for(m=b(f.data[V])-1;V>=0;){if(m>=Q)var F=f.data[V]>>m-Q&S;else F=(f.data[V]&(1<<m+1)-1)<<Q-m,V>0&&(F|=f.data[V-1]>>this.DB+m-Q);for(P=H;(F&1)==0;)F>>=1,--P;(m-=P)<0&&(m+=this.DB,--V);if(v)L[F].copyTo(x),v=!1;else{for(;P>1;)e.sqrTo(x,I),e.sqrTo(I,x),P-=2;P>0?e.sqrTo(x,I):(P=x,x=I,I=P);e.mulTo(I,L[F],x)}for(;V>=0&&(f.data[V]&1<<m)==0;)e.sqrTo(x,I),P=x,x=I,I=P,--m<0&&(m=this.DB-
2571,--V)}return e.revert(x)};p.prototype.modInverse=function(f){if(this.signum()==0)return p.ZERO;var e=f.isEven();if(this.isEven()&&e||f.signum()==0)return p.ZERO;for(var m=f.clone(),x=this.clone(),H=a(1),L=a(0),P=a(0),Q=a(1);m.signum()!=0;){for(;m.isEven();)m.rShiftTo(1,m),e?(H.isEven()&&L.isEven()||(H.addTo(this,H),L.subTo(f,L)),H.rShiftTo(1,H)):L.isEven()||L.subTo(f,L),L.rShiftTo(1,L);for(;x.isEven();)x.rShiftTo(1,x),e?(P.isEven()&&Q.isEven()||(P.addTo(this,P),Q.subTo(f,Q)),P.rShiftTo(1,P)):Q.isEven()||
258Q.subTo(f,Q),Q.rShiftTo(1,Q);m.compareTo(x)>=0?(m.subTo(x,m),e&&H.subTo(P,H),L.subTo(Q,L)):(x.subTo(m,x),e&&P.subTo(H,P),Q.subTo(L,Q))}if(x.compareTo(p.ONE)!=0)return p.ZERO;if(Q.compareTo(f)>=0)return Q.subtract(f);if(Q.signum()<0)Q.addTo(f,Q);else return Q;return Q.signum()<0?Q.add(f):Q};p.prototype.pow=function(f){return this.exp(f,new d)};p.prototype.gcd=function(f){var e=this.s<0?this.negate():this.clone();f=f.s<0?f.negate():f.clone();if(e.compareTo(f)<0){var m=e;e=f;f=m}m=e.getLowestSetBit();
259var x=f.getLowestSetBit();if(x<0)return e;m<x&&(x=m);x>0&&(e.rShiftTo(x,e),f.rShiftTo(x,f));for(;e.signum()>0;)(m=e.getLowestSetBit())>0&&e.rShiftTo(m,e),(m=f.getLowestSetBit())>0&&f.rShiftTo(m,f),e.compareTo(f)>=0?(e.subTo(f,e),e.rShiftTo(1,e)):(f.subTo(e,f),f.rShiftTo(1,f));x>0&&f.lShiftTo(x,f);return f};p.prototype.isProbablePrime=function(f){var e,m=this.abs();if(m.t==1&&m.data[0]<=k[k.length-1]){for(e=0;e<k.length;++e)if(m.data[0]==k[e])return!0;return!1}if(m.isEven())return!1;for(e=1;e<k.length;){for(var x=
260k[e],H=e+1;H<k.length&&x<w;)x*=k[H++];for(x=m.modInt(x);e<H;)if(x%k[e++]==0)return!1}return m.millerRabin(f)};p.prototype.square=function(){var f=E();this.squareTo(f);return f}},
260"./lib/kem.js":function(K,r,C){function p(y,l,c,a){y.generate=function(b,g){for(var u=new E.util.ByteBuffer,G=Math.ceil(g/a)+c,h=new E.util.ByteBuffer,B=c;B<G;++B){h.putInt32(B);l.start();l.update(b+h.getBytes());var t=l.digest();u.putBytes(t.getBytes(a))}u.truncate(u.length()-g);return u.getBytes()}}var E=C("./lib/forge.js");
261C("./lib/util.js");C("./lib/random.js");C("./lib/jsbn.js");K.exports=E.kem=E.kem||{};var O=E.jsbn.BigInteger;E.kem.rsa={};E.kem.rsa.create=function(y,l){l=l||{};var c=l.prng||E.random;return{encrypt:function(a,b){var g=Math.ceil(a.n.bitLength()/8);do var u=(new O(E.util.bytesToHex(c.getBytesSync(g)),16)).mod(a.n);while(u.compareTo(O.ONE)<=0);u=E.util.hexToBytes(u.toString(16));g-=u.length;g>0&&(u=E.util.fillString(String.fromCharCode(0),g)+u);a=a.encrypt(u,"NONE");b=y.generate(u,b);return{encapsulation:a,
262key:b}},decrypt:function(a,b,g){a=a.decrypt(b,"NONE");return y.generate(a,g)}}};E.kem.kdf1=function(y,l){p(this,y,0,l||y.digestLength)};E.kem.kdf2=function(y,l){p(this,y,1,l||y.digestLength)}},
262"./lib/log.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/util.js");K.exports=p.log=p.log||{};p.log.levels="none error warning info debug verbose max".split(" ");var E={},O=[];K=null;p.log.LEVEL_LOCKED=2;p.log.NO_LEVEL_CHECK=4;p.log.INTERPOLATE=8;for(r=0;r<p.log.levels.length;++r)C=p.log.levels[r],E[C]=
263{index:r,name:C.toUpperCase()};p.log.logMessage=function(l){for(var c=E[l.level].index,a=0;a<O.length;++a){var b=O[a];b.flags&p.log.NO_LEVEL_CHECK?b.f(l):c<=E[b.level].index&&b.f(b,l)}};p.log.prepareStandard=function(l){"standard"in l||(l.standard=E[l.level].name+" ["+l.category+"] "+l.message)};p.log.prepareFull=function(l){if(!("full"in l)){var c=[l.message];c=c.concat([]);l.full=p.util.format.apply(this,c)}};p.log.prepareStandardFull=function(l){"standardFull"in l||(p.log.prepareStandard(l),l.standardFull=
264l.standard)};C=["error","warning","info","debug","verbose"];for(r=0;r<C.length;++r)(function(l){p.log[l]=function(c,a){var b=Array.prototype.slice.call(arguments).slice(2);p.log.logMessage({timestamp:new Date,level:l,category:c,message:a,arguments:b})}})(C[r]);p.log.makeLogger=function(l){l={flags:0,f:l};p.log.setLevel(l,"none");return l};p.log.setLevel=function(l,c){var a=!1;if(l&&!(l.flags&p.log.LEVEL_LOCKED))for(var b=0;b<p.log.levels.length;++b)if(c==p.log.levels[b]){l.level=c;a=!0;break}return a};
265p.log.lock=function(l,c){l.flags=typeof c==="undefined"||c?l.flags|p.log.LEVEL_LOCKED:l.flags&~p.log.LEVEL_LOCKED};p.log.addLogger=function(l){O.push(l)};if(typeof console!=="undefined"&&"log"in console){if(console.error&&console.warn&&console.info&&console.debug){var y={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug};K=function(l,c){p.log.prepareStandard(c);l=y[c.level];var a=[c.standard];a=a.concat(c.arguments.slice());l.apply(console,a)}}else K=
266function(l,c){p.log.prepareStandardFull(c);console.log(c.standardFull)};K=p.log.makeLogger(K);p.log.setLevel(K,"debug");p.log.addLogger(K)}else console={log:function(){}};K!==null&&typeof window!=="undefined"&&window.location&&(r=(new URL(window.location.href)).searchParams,r.has("console.level")&&p.log.setLevel(K,r.get("console.level").slice(-1)[0]),r.has("console.lock")&&r.get("console.lock").slice(-1)[0]=="true"&&p.log.lock(K));p.log.consoleLogger=K},
266"./lib/md.all.js":function(K,r,C){K.exports=
267C("./lib/md.js");C("./lib/md5.js");C("./lib/sha1.js");C("./lib/sha256.js");C("./lib/sha512.js")},
267"./lib/md.js":function(K,r,C){r=C("./lib/forge.js");K.exports=r.md=r.md||{};r.md.algorithms=r.md.algorithms||{}},
267"./lib/md5.js":function(K,r,C){function p(){y=String.fromCharCode(128);y+=O.util.fillString(String.fromCharCode(0),64);l=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9];c=[7,12,17,22,7,
26812,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21];a=Array(64);for(var g=0;g<64;++g)a[g]=Math.floor(Math.abs(Math.sin(g+1))*4294967296);b=!0}function E(g,u,G){for(var h,B,t,d,q,A,D,J=G.length();J>=64;){B=g.h0;t=g.h1;d=g.h2;q=g.h3;for(D=0;D<16;++D)u[D]=G.getInt32Le(),h=q^t&(d^q),h=B+h+a[D]+u[D],A=c[D],B=q,q=d,d=t,t+=h<<A|h>>>32-A;for(;D<32;++D)h=d^q&(t^d),h=B+h+a[D]+u[l[D]],A=c[D],B=q,q=d,d=
269t,t+=h<<A|h>>>32-A;for(;D<48;++D)h=t^d^q,h=B+h+a[D]+u[l[D]],A=c[D],B=q,q=d,d=t,t+=h<<A|h>>>32-A;for(;D<64;++D)h=d^(t|~q),h=B+h+a[D]+u[l[D]],A=c[D],B=q,q=d,d=t,t+=h<<A|h>>>32-A;g.h0=g.h0+B|0;g.h1=g.h1+t|0;g.h2=g.h2+d|0;g.h3=g.h3+q|0;J-=64}}var O=C("./lib/forge.js");C("./lib/md.js");C("./lib/util.js");K=K.exports=O.md5=O.md5||{};O.md.md5=O.md.algorithms.md5=K;K.create=function(){b||p();var g=null,u=O.util.createBuffer(),G=Array(16),h={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,
270messageLengthSize:8,start:function(){h.messageLength=0;h.fullMessageLength=h.messageLength64=[];for(var B=h.messageLengthSize/4,t=0;t<B;++t)h.fullMessageLength.push(0);u=O.util.createBuffer();g={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878};return h}};h.start();h.update=function(B,t){t==="utf8"&&(B=O.util.encodeUtf8(B));t=B.length;h.messageLength+=t;t=[t/4294967296>>>0,t>>>0];for(var d=h.fullMessageLength.length-1;d>=0;--d)h.fullMessageLength[d]+=t[1],t[1]=t[0]+(h.fullMessageLength[d]/4294967296>>>
2710),h.fullMessageLength[d]>>>=0,t[0]=t[1]/4294967296>>>0;u.putBytes(B);E(g,G,u);(u.read>2048||u.length()===0)&&u.compact();return h};h.digest=function(){var B=O.util.createBuffer();B.putBytes(u.bytes());B.putBytes(y.substr(0,h.blockLength-(h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1)));for(var t,d=0,q=h.fullMessageLength.length-1;q>=0;--q)t=h.fullMessageLength[q]*8+d,d=t/4294967296>>>0,B.putInt32Le(t>>>0);t={h0:g.h0,h1:g.h1,h2:g.h2,h3:g.h3};E(t,G,B);B=O.util.createBuffer();
272B.putInt32Le(t.h0);B.putInt32Le(t.h1);B.putInt32Le(t.h2);B.putInt32Le(t.h3);return B};return h};var y=null,l=null,c=null,a=null,b=!1},
272"./lib/mgf.js":function(K,r,C){r=C("./lib/forge.js");C("./lib/mgf1.js");K.exports=r.mgf=r.mgf||{};r.mgf.mgf1=r.mgf1},
272"./lib/mgf1.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/util.js");p.mgf=p.mgf||{};(K.exports=p.mgf.mgf1=p.mgf1=p.mgf1||{}).create=function(E){return{generate:function(O,y){for(var l=new p.util.ByteBuffer,c=Math.ceil(y/E.digestLength),a=0;a<
273c;a++){var b=new p.util.ByteBuffer;b.putInt32(a);E.start();E.update(O+b.getBytes());l.putBuffer(E.digest())}l.truncate(l.length()-y);return l.getBytes()}}}},
273"./lib/oids.js":function(K,r,C){function p(O,y){E[O]=y;E[y]=O}r=C("./lib/forge.js");r.pki=r.pki||{};var E=K.exports=r.pki.oids=r.oids=r.oids||{};p("1.2.840.113549.1.1.1","rsaEncryption");p("1.2.840.113549.1.1.4","md5WithRSAEncryption");p("1.2.840.113549.1.1.5","sha1WithRSAEncryption");p("1.2.840.113549.1.1.7","RSAES-OAEP");p("1.2.840.113549.1.1.8",
274"mgf1");p("1.2.840.113549.1.1.9","pSpecified");p("1.2.840.113549.1.1.10","RSASSA-PSS");p("1.2.840.113549.1.1.11","sha256WithRSAEncryption");p("1.2.840.113549.1.1.12","sha384WithRSAEncryption");p("1.2.840.113549.1.1.13","sha512WithRSAEncryption");p("1.3.101.112","EdDSA25519");p("1.2.840.10040.4.3","dsa-with-sha1");p("1.3.14.3.2.7","desCBC");p("1.3.14.3.2.26","sha1");p("1.3.14.3.2.29","sha1WithRSASignature");p("2.16.840.1.101.3.4.2.1","sha256");p("2.16.840.1.101.3.4.2.2","sha384");p("2.16.840.1.101.3.4.2.3",
275"sha512");p("2.16.840.1.101.3.4.2.4","sha224");p("2.16.840.1.101.3.4.2.5","sha512-224");p("2.16.840.1.101.3.4.2.6","sha512-256");p("1.2.840.113549.2.2","md2");p("1.2.840.113549.2.5","md5");p("1.2.840.113549.1.7.1","data");p("1.2.840.113549.1.7.2","signedData");p("1.2.840.113549.1.7.3","envelopedData");p("1.2.840.113549.1.7.4","signedAndEnvelopedData");p("1.2.840.113549.1.7.5","digestedData");p("1.2.840.113549.1.7.6","encryptedData");p("1.2.840.113549.1.9.1","emailAddress");p("1.2.840.113549.1.9.2",
276"unstructuredName");p("1.2.840.113549.1.9.3","contentType");p("1.2.840.113549.1.9.4","messageDigest");p("1.2.840.113549.1.9.5","signingTime");p("1.2.840.113549.1.9.6","counterSignature");p("1.2.840.113549.1.9.7","challengePassword");p("1.2.840.113549.1.9.8","unstructuredAddress");p("1.2.840.113549.1.9.14","extensionRequest");p("1.2.840.113549.1.9.20","friendlyName");p("1.2.840.113549.1.9.21","localKeyId");p("1.2.840.113549.1.9.22.1","x509Certificate");p("1.2.840.113549.1.12.10.1.1","keyBag");p("1.2.840.113549.1.12.10.1.2",
277"pkcs8ShroudedKeyBag");p("1.2.840.113549.1.12.10.1.3","certBag");p("1.2.840.113549.1.12.10.1.4","crlBag");p("1.2.840.113549.1.12.10.1.5","secretBag");p("1.2.840.113549.1.12.10.1.6","safeContentsBag");p("1.2.840.113549.1.5.13","pkcs5PBES2");p("1.2.840.113549.1.5.12","pkcs5PBKDF2");p("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");p("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");p("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");p("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");
278p("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");p("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");p("1.2.840.113549.2.7","hmacWithSHA1");p("1.2.840.113549.2.8","hmacWithSHA224");p("1.2.840.113549.2.9","hmacWithSHA256");p("1.2.840.113549.2.10","hmacWithSHA384");p("1.2.840.113549.2.11","hmacWithSHA512");p("1.2.840.113549.3.7","des-EDE3-CBC");p("2.16.840.1.101.3.4.1.2","aes128-CBC");p("2.16.840.1.101.3.4.1.22","aes192-CBC");
278p("2.16.840.1.101.3.4.1.42","aes256-CBC");p("2.5.4.3","commonName");
279p("2.5.4.4","surname");p("2.5.4.5","serialNumber");p("2.5.4.6","countryName");p("2.5.4.7","localityName");p("2.5.4.8","stateOrProvinceName");p("2.5.4.9","streetAddress");p("2.5.4.10","organizationName");p("2.5.4.11","organizationalUnitName");p("2.5.4.12","title");p("2.5.4.13","description");p("2.5.4.15","businessCategory");p("2.5.4.17","postalCode");p("2.5.4.42","givenName");p("2.5.4.65","pseudonym");p("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");p("1.3.6.1.4.1.311.60.2.1.3",
280"jurisdictionOfIncorporationCountryName");p("2.16.840.1.113730.1.1","nsCertType");p("2.16.840.1.113730.1.13","nsComment");E["2.5.29.1"]="authorityKeyIdentifier";E["2.5.29.2"]="keyAttributes";E["2.5.29.3"]="certificatePolicies";E["2.5.29.4"]="keyUsageRestriction";E["2.5.29.5"]="policyMapping";E["2.5.29.6"]="subtreesConstraint";E["2.5.29.7"]="subjectAltName";E["2.5.29.8"]="issuerAltName";E["2.5.29.9"]="subjectDirectoryAttributes";E["2.5.29.10"]="basicConstraints";E["2.5.29.11"]="nameConstraints";E["2.5.29.12"]=
281"policyConstraints";E["2.5.29.13"]="basicConstraints";p("2.5.29.14","subjectKeyIdentifier");p("2.5.29.15","keyUsage");E["2.5.29.16"]="privateKeyUsagePeriod";p("2.5.29.17","subjectAltName");p("2.5.29.18","issuerAltName");p("2.5.29.19","basicConstraints");E["2.5.29.20"]="cRLNumber";E["2.5.29.21"]="cRLReason";E["2.5.29.22"]="expirationDate";E["2.5.29.23"]="instructionCode";E["2.5.29.24"]="invalidityDate";E["2.5.29.25"]="cRLDistributionPoints";E["2.5.29.26"]="issuingDistributionPoint";E["2.5.29.27"]=
282"deltaCRLIndicator";E["2.5.29.28"]="issuingDistributionPoint";E["2.5.29.29"]="certificateIssuer";E["2.5.29.30"]="nameConstraints";p("2.5.29.31","cRLDistributionPoints");p("2.5.29.32","certificatePolicies");E["2.5.29.33"]="policyMappings";E["2.5.29.34"]="policyConstraints";p("2.5.29.35","authorityKeyIdentifier");E["2.5.29.36"]="policyConstraints";p("2.5.29.37","extKeyUsage");E["2.5.29.46"]="freshestCRL";E["2.5.29.54"]="inhibitAnyPolicy";p("1.3.6.1.4.1.11129.2.4.2","timestampList");p("1.3.6.1.5.5.7.1.1",
283"authorityInfoAccess");p("1.3.6.1.5.5.7.3.1","serverAuth");p("1.3.6.1.5.5.7.3.2","clientAuth");p("1.3.6.1.5.5.7.3.3","codeSigning");p("1.3.6.1.5.5.7.3.4","emailProtection");p("1.3.6.1.5.5.7.3.8","timeStamping")},
283"./lib/pbe.js":function(K,r,C){function p(h,B){return h.start().update(B).digest().getBytes()}function E(h){if(h){var B=a.oids[c.derToOid(h)];if(!B)throw B=Error("Unsupported PRF OID."),B.oid=h,B.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],
284B;}else B="hmacWithSHA1";return O(B)}function O(h){var B=y.md;switch(h){case "hmacWithSHA224":B=y.md.sha512;case "hmacWithSHA1":case "hmacWithSHA256":case "hmacWithSHA384":case "hmacWithSHA512":h=h.substr(8).toLowerCase();break;default:throw B=Error("Unsupported PRF algorithm."),B.algorithm=h,B.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],B;}if(!(B&&h in B))throw Error("Unknown hash algorithm: "+h);return B[h].create()}var y=C("./lib/forge.js");C("./lib/aes.js");
285C("./lib/asn1.js");C("./lib/des.js");C("./lib/md.js");C("./lib/oids.js");C("./lib/pbkdf2.js");C("./lib/pem.js");C("./lib/random.js");C("./lib/rc2.js");C("./lib/rsa.js");C("./lib/util.js");if(typeof l==="undefined")var l=y.jsbn.BigInteger;var c=y.asn1,a=y.pki=y.pki||{};K.exports=a.pbe=y.pbe=y.pbe||{};var b=a.oids,g={name:"EncryptedPrivateKeyInfo",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,
286constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:c.Class.UNIVERSAL,type:c.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:c.Class.UNIVERSAL,type:c.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},u={name:"PBES2Algorithms",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,
287value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:c.Class.UNIVERSAL,type:c.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:c.Class.UNIVERSAL,type:c.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",
288tagClass:c.Class.UNIVERSAL,type:c.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:c.Class.UNIVERSAL,type:c.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:c.Class.UNIVERSAL,type:c.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",
289tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:c.Class.UNIVERSAL,type:c.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:c.Class.UNIVERSAL,type:c.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},G={name:"pkcs-12PbeParams",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:c.Class.UNIVERSAL,type:c.Type.OCTETSTRING,constructed:!1,
290capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:c.Class.UNIVERSAL,type:c.Type.INTEGER,constructed:!1,capture:"iterations"}]};a.encryptPrivateKeyInfo=function(h,B,t){t=t||{};t.saltSize=t.saltSize||8;t.count=t.count||2048;t.algorithm=t.algorithm||"aes128";t.prfAlgorithm=t.prfAlgorithm||"sha1";var d=y.random.getBytesSync(t.saltSize),q=t.count,A=c.integerToDer(q),D;if(t.algorithm.indexOf("aes")===0||t.algorithm==="des"){switch(t.algorithm){case "aes128":var J=D=16;var k=b["aes128-CBC"];var w=
291y.aes.createEncryptionCipher;break;case "aes192":D=24;J=16;k=b["aes192-CBC"];w=y.aes.createEncryptionCipher;break;case "aes256":D=32;J=16;k=b["aes256-CBC"];w=y.aes.createEncryptionCipher;break;case "des":J=D=8;k=b.desCBC;w=y.des.createEncryptionCipher;break;default:throw d=Error("Cannot encrypt private key. Unknown encryption algorithm."),d.algorithm=t.algorithm,d;}t="hmacWith"+t.prfAlgorithm.toUpperCase();var f=O(t);f=y.pkcs5.pbkdf2(B,d,q,D,f);B=y.random.getBytesSync(J);q=w(f);q.start(B);q.update(c.toDer(h));
292q.finish();h=q.output.getBytes();d=c.create(c.Class.UNIVERSAL,c.Type.SEQUENCE,!0,[c.create(c.Class.UNIVERSAL,c.Type.OCTETSTRING,!1,d),c.create(c.Class.UNIVERSAL,c.Type.INTEGER,!1,A.getBytes())]);t!=="hmacWithSHA1"&&d.value.push(c.create(c.Class.UNIVERSAL,c.Type.INTEGER,!1,y.util.hexToBytes(D.toString(16))),c.create(c.Class.UNIVERSAL,c.Type.SEQUENCE,!0,[c.create(c.Class.UNIVERSAL,c.Type.OID,!1,c.oidToDer(a.oids[t]).getBytes()),c.create(c.Class.UNIVERSAL,c.Type.NULL,!1,"")]));d=c.create(c.Class.UNIVERSAL,
293c.Type.SEQUENCE,!0,[c.create(c.Class.UNIVERSAL,c.Type.OID,!1,c.oidToDer(b.pkcs5PBES2).getBytes()),c.create(c.Class.UNIVERSAL,c.Type.SEQUENCE,!0,[c.create(c.Class.UNIVERSAL,c.Type.SEQUENCE,!0,[c.create(c.Class.UNIVERSAL,c.Type.OID,!1,c.oidToDer(b.pkcs5PBKDF2).getBytes()),d]),c.create(c.Class.UNIVERSAL,c.Type.SEQUENCE,!0,[c.create(c.Class.UNIVERSAL,c.Type.OID,!1,c.oidToDer(k).getBytes()),c.create(c.Class.UNIVERSAL,c.Type.OCTETSTRING,!1,B)])])])}else if(t.algorithm==="3des")D=24,k=new y.util.ByteBuffer(d),
294f=a.pbe.generatePkcs12Key(B,k,1,q,D),B=a.pbe.generatePkcs12Key(B,k,2,q,D),q=y.des.createEncryptionCipher(f),q.start(B),q.update(c.toDer(h)),q.finish(),h=q.output.getBytes(),d=c.create(c.Class.UNIVERSAL,c.Type.SEQUENCE,!0,[c.create(c.Class.UNIVERSAL,c.Type.OID,!1,c.oidToDer(b["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),c.create(c.Class.UNIVERSAL,c.Type.SEQUENCE,!0,[c.create(c.Class.UNIVERSAL,c.Type.OCTETSTRING,!1,d),c.create(c.Class.UNIVERSAL,c.Type.INTEGER,!1,A.getBytes())])]);else throw d=Error("Cannot encrypt private key. Unknown encryption algorithm."),
295d.algorithm=t.algorithm,d;return c.create(c.Class.UNIVERSAL,c.Type.SEQUENCE,!0,[d,c.create(c.Class.UNIVERSAL,c.Type.OCTETSTRING,!1,h)])};a.decryptPrivateKeyInfo=function(h,B){var t=null,d={},q=[];if(!c.validate(h,g,d,q))throw t=Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),t.errors=q,t;q=c.derToOid(d.encryptionOid);B=a.pbe.getCipher(q,d.encryptionParams,B);d=y.util.createBuffer(d.encryptedData);B.update(d);B.finish()&&(t=c.fromDer(B.output));
296return t};a.encryptedPrivateKeyToPem=function(h,B){h={type:"ENCRYPTED PRIVATE KEY",body:c.toDer(h).getBytes()};return y.pem.encode(h,{maxline:B})};a.encryptedPrivateKeyFromPem=function(h){h=y.pem.decode(h)[0];if(h.type!=="ENCRYPTED PRIVATE KEY"){var B=Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');B.headerType=h.type;throw B;}if(h.procType&&h.procType.type==="ENCRYPTED")throw Error("Could not convert encrypted private key from PEM; PEM is encrypted.");
297return c.fromDer(h.body)};a.encryptRsaPrivateKey=function(h,B,t){t=t||{};if(!t.legacy)return h=a.wrapRsaPrivateKey(a.privateKeyToAsn1(h)),h=a.encryptPrivateKeyInfo(h,B,t),a.encryptedPrivateKeyToPem(h);switch(t.algorithm){case "aes128":t="AES-128-CBC";var d=16;var q=y.random.getBytesSync(16);var A=y.aes.createEncryptionCipher;break;
297case "aes192":t="AES-192-CBC";d=24;q=y.random.getBytesSync(16);A=y.aes.createEncryptionCipher;break;case "aes256":t="AES-256-CBC";d=32;q=y.random.getBytesSync(16);A=y.aes.createEncryptionCipher;
298break;case "3des":t="DES-EDE3-CBC";d=24;q=y.random.getBytesSync(8);A=y.des.createEncryptionCipher;break;case "des":t="DES-CBC";d=8;q=y.random.getBytesSync(8);A=y.des.createEncryptionCipher;break;default:throw h=Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+t.algorithm+'".'),h.algorithm=t.algorithm,h;}B=y.pbe.opensslDeriveBytes(B,q.substr(0,8),d);B=A(B);B.start(q);B.update(c.toDer(a.privateKeyToAsn1(h)));B.finish();h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},
299dekInfo:{algorithm:t,parameters:y.util.bytesToHex(q).toUpperCase()},body:B.output.getBytes()};return y.pem.encode(h)};a.decryptRsaPrivateKey=function(h,B){var t=null;h=y.pem.decode(h)[0];if(h.type!=="ENCRYPTED PRIVATE KEY"&&h.type!=="PRIVATE KEY"&&h.type!=="RSA PRIVATE KEY")throw B=Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'),B.headerType=B,B;if(h.procType&&h.procType.type==="ENCRYPTED"){switch(h.dekInfo.algorithm){case "DES-CBC":var d=
3008;var q=y.des.createDecryptionCipher;break;case "DES-EDE3-CBC":d=24;q=y.des.createDecryptionCipher;break;case "AES-128-CBC":d=16;q=y.aes.createDecryptionCipher;break;case "AES-192-CBC":d=24;q=y.aes.createDecryptionCipher;break;case "AES-256-CBC":d=32;q=y.aes.createDecryptionCipher;break;case "RC2-40-CBC":d=5;q=function(D){return y.rc2.createDecryptionCipher(D,40)};break;case "RC2-64-CBC":d=8;q=function(D){return y.rc2.createDecryptionCipher(D,64)};break;case "RC2-128-CBC":d=16;q=function(D){return y.rc2.createDecryptionCipher(D,
301128)};break;default:throw B=Error('Could not decrypt private key; unsupported encryption algorithm "'+h.dekInfo.algorithm+'".'),B.algorithm=h.dekInfo.algorithm,B;}var A=y.util.hexToBytes(h.dekInfo.parameters);d=y.pbe.opensslDeriveBytes(B,A.substr(0,8),d);q=q(d);q.start(A);q.update(y.util.createBuffer(h.body));if(q.finish())t=q.output.getBytes();else return t}else t=h.body;t=h.type==="ENCRYPTED PRIVATE KEY"?a.decryptPrivateKeyInfo(c.fromDer(t),B):c.fromDer(t);t!==null&&(t=a.privateKeyFromAsn1(t));
302return t};a.pbe.generatePkcs12Key=function(h,B,t,d,q,A){var D,J;if(typeof A==="undefined"||A===null){if(!("sha1"in y.md))throw Error('"sha1" hash algorithm unavailable.');A=y.md.sha1.create()}var k=A.digestLength,w=A.blockLength,f=new y.util.ByteBuffer,e=new y.util.ByteBuffer;if(h!==null&&h!==void 0){for(J=0;J<h.length;J++)e.putInt16(h.charCodeAt(J));e.putInt16(0)}h=e.length();var m=B.length(),x=new y.util.ByteBuffer;x.fillWithByte(t,w);var H=w*Math.ceil(m/w);t=new y.util.ByteBuffer;for(J=0;J<H;J++)t.putByte(B.at(J%
303m));H=w*Math.ceil(h/w);B=new y.util.ByteBuffer;for(J=0;J<H;J++)B.putByte(e.at(J%h));e=t;e.putBuffer(B);B=Math.ceil(q/k);for(t=1;t<=B;t++){H=new y.util.ByteBuffer;H.putBytes(x.bytes());H.putBytes(e.bytes());for(J=0;J<d;J++)A.start(),A.update(H.getBytes()),H=A.digest();var L=new y.util.ByteBuffer;for(J=0;J<w;J++)L.putByte(H.at(J%k));var P=Math.ceil(m/w)+Math.ceil(h/w),Q=new y.util.ByteBuffer;for(D=0;D<P;D++){var S=new y.util.ByteBuffer(e.getBytes(w)),V=511;for(J=L.length()-1;J>=0;J--)V>>=8,V+=L.at(J)+
304S.at(J),S.setAt(J,V&255);Q.putBuffer(S)}e=Q;f.putBuffer(H)}f.truncate(f.length()-q);return f};a.pbe.getCipher=function(h,B,t){switch(h){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(h,B,t);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(h,B,t);default:throw B=Error("Cannot read encrypted PBE data block. Unsupported OID."),B.oid=h,B.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],
305B;}};a.pbe.getCipherForPBES2=function(h,B,t){var d={};h=[];if(!c.validate(B,u,d,h)){var q=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");q.errors=h;throw q;}h=c.derToOid(d.kdfOid);if(h!==a.oids.pkcs5PBKDF2)throw q=Error("Cannot read encrypted private key. Unsupported key derivation function OID."),q.oid=h,q.supp
305ortedOids=["pkcs5PBKDF2"],q;h=c.derToOid(d.encOid);if(h!==a.oids["aes128-CBC"]&&h!==a.oids["aes192-CBC"]&&h!==
306a.oids["aes256-CBC"]&&h!==a.oids["des-EDE3-CBC"]&&h!==a.oids.desCBC)throw q=Error("Cannot read encrypted private key. Unsupported encryption scheme OID."),q.oid=h,q.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],q;B=d.kdfSalt;var A=y.util.createBuffer(d.kdfIterationCount);A=A.getInt(A.length()<<3);switch(a.oids[h]){case "aes128-CBC":var D=16;q=y.aes.createDecryptionCipher;break;case "aes192-CBC":D=24;q=y.aes.createDecryptionCipher;break;case "aes256-CBC":D=32;q=y.aes.createDecryptionCipher;
307break;case "des-EDE3-CBC":D=24;q=y.des.createDecryptionCipher;break;case "desCBC":D=8,q=y.des.createDecryptionCipher}h=E(d.prfOid);t=y.pkcs5.pbkdf2(t,B,A,D,h);d=d.encIv;q=q(t);q.start(d);return q};a.pbe.getCipherForPKCS12PBE=function(h,B,t){var d={},q=[];if(!c.validate(B,G,d,q))throw t=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),t.errors=q,t;q=y.util.createBuffer(d.salt);B=y.util.createBuffer(d.iterations);B=B.getInt(B.length()<<
3083);switch(h){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:var A=24;var D=8;h=y.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:A=5;D=8;h=function(J,k){J=y.rc2.createDecryptionCipher(J,40);J.start(k,null);return J};break;default:throw t=Error("Cannot read PKCS #12 PBE data block. Unsupported OID."),t.oid=h,t;}d=E(d.prfOid);A=a.pbe.generatePkcs12Key(t,q,1,B,A,d);d.start();t=a.pbe.generatePkcs12Key(t,q,2,B,D,d);return h(A,t)};a.pbe.opensslDeriveBytes=function(h,B,t,d){if(typeof d===
309"undefined"||d===null){if(!("md5"in y.md))throw Error('"md5" hash algorithm unavailable.');d=y.md.md5.create()}B===null&&(B="");for(var q=[p(d,h+B)],A=16,D=1;A<t;++D,A+=16)q.push(p(d,q[D-1]+h+B));return q.join("").substr(0,t)}},
309"./lib/pbkdf2.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/hmac.js");C("./lib/md.js");C("./lib/util.js");r=p.pkcs5=p.pkcs5||{};var E;p.util.isNodejs&&!p.options.usePureJavaScript&&(E=C(1));K.exports=p.pbkdf2=r.pbkdf2=function(O,y,l,c,a,b){function g(){if(A>h)return b(null,
310d);t.start(null,null);t.update(y);t.update(p.util.int32ToBytes(A));D=q=t.digest().getBytes();J=2;u()}function u(){if(J<=l)return t.start(null,null),t.update(q),k=t.digest().getBytes(),D=p.util.xorBytes(D,k,G),q=k,++J,p.util.setImmediate(u);d+=A<h?D:D.substr(0,B);++A;g()}typeof a==="function"&&(b=a,a=null);if(p.util.isNodejs&&!p.options.usePureJavaScript&&E.pbkdf2&&(a===null||typeof a!=="object")&&(E.pbkdf2Sync.length>4||!a||a==="sha1"))return typeof a!=="string"&&(a="sha1"),O=Buffer.from(O,"binary"),
311y=Buffer.from(y,"binary"),b?E.pbkdf2Sync.length===4?E.pbkdf2(O,y,l,c,function(w,f){if(w)return b(w);b(null,f.toString("binary"))}):E.pbkdf2(O,y,l,c,a,function(w,f){if(w)return b(w);b(null,f.toString("binary"))}):E.pbkdf2Sync.length===4?E.pbkdf2Sync(O,y,l,c).toString("binary"):E.pbkdf2Sync(O,y,l,c,a).toString("binary");if(typeof a==="undefined"||a===null)a="sha1";if(typeof a==="string"){if(!(a in p.md.algorithms))throw Error("Unknown hash algorithm: "+a);a=p.md[a].create()}var G=a.digestLength;if(c>
3124294967295*G){O=Error("Derived key is too long.");if(b)return b(O);throw O;}var h=Math.ceil(c/G),B=c-(h-1)*G,t=p.hmac.create();t.start(a,O);var d="",q;if(!b){for(var A=1;A<=h;++A){t.start(null,null);t.update(y);t.update(p.util.int32ToBytes(A));var D=q=t.digest().getBytes();for(var J=2;J<=l;++J){t.start(null,null);t.update(q);var k=t.digest().getBytes();D=p.util.xorBytes(D,k,G);q=k}d+=A<h?D:D.substr(0,B)}return d}A=1;g()}},
312"./lib/pem.js":function(K,r,C){function p(O){for(var y=O.name+": ",l=[],c=function(b,
313g){return" "+g},a=0;a<O.values.length;++a)l.push(O.values[a].replace(/^(\S+\r\n)/,c));y+=l.join(",")+"\r\n";l=0;O=-1;for(a=0;a<y.length;++a,++l)if(l>65&&O!==-1)l=y[O],l===","?(++O,y=y.substr(0,O)+"\r\n "+y.substr(O)):y=y.substr(0,O)+"\r\n"+l+y.substr(O+1),l=a-O-1,O=-1,++a;else if(y[a]===" "||y[a]==="\t"||y[a]===",")O=a;return y}var E=C("./lib/forge.js");C("./lib/util.js");K=K.exports=E.pem=E.pem||{};K.encode=function(O,y){y=y||{};var l="-----BEGIN "+O.type+"-----\r\n";if(O.procType){var c={name:"Proc-Type",
314values:[String(O.procType.version),O.procType.type]};l+=p(c)}O.contentDomain&&(c={name:"Content-Domain",values:[O.contentDomain]},l+=p(c));O.dekInfo&&(c={name:"DEK-Info",values:[O.dekInfo.algorithm]},O.dekInfo.parameters&&c.values.push(O.dekInfo.parameters),l+=p(c));if(O.headers)for(c=0;c<O.headers.length;++c)l+=p(O.headers[c]);O.procType&&(l+="\r\n");l+=E.util.encode64(O.body,y.maxline||64)+"\r\n";return l+="-----END "+O.type+"-----\r\n"};K.decode=function(O){for(var y=[],l=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,
315c=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,a=/\r?\n/,b;;){b=l.exec(O);if(!b)break;var g=b[1];g==="NEW CERTIFICATE REQUEST"&&(g="CERTIFICATE REQUEST");g={type:g,procType:null,contentDomain:null,dekInfo:null,headers:[],body:E.util.decode64(b[3])};y.push(g);if(b[2]){for(var u=b[2].split(a),G=0;b&&G<u.length;){b=u[G].replace(/\s+$/,"");for(var h=G+1;h<u.length;++h){var B=u[h];if(!/\s/.test(B[0]))break;b+=B;G=h}if(b=b.match(c)){h={name:b[1],values:[]};B=b[2].split(",");for(var t=0;t<B.length;++t)h.values.push(B[t].replace(/^\s+/,
316""));if(g.procType)if(g.contentDomain||h.name!=="Content-Domain")if(g.dekInfo||h.name!=="DEK-Info")g.headers.push(h);else{if(h.values.length===0)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');g.dekInfo={algorithm:B[0],parameters:B[1]||null}}else g.contentDomain=B[0]||"";else{if(h.name!=="Proc-Type")throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(h.values.length!==2)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');
317g.procType={version:B[0],type:B[1]}}}++G}if(g.procType==="ENCRYPTED"&&!g.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".');}}if(y.length===0)throw Error("Invalid PEM formatted message.");return y}},
317"./lib/pkcs1.js":function(K,r,C){function p(O,y,l){l||(l=E.md.sha1.create());for(var c="",a=Math.ceil(y/l.digestLength),b=0;b<a;++b){var g=String.fromCharCode(b>>24&255,b>>16&255,b>>8&255,b&255);l.start();l.update(O+g);c+=l.digest().getBytes()}return c.substring(0,
318y)}var E=C("./lib/forge.js");C("./lib/util.js");C("./lib/random.js");C("./lib/sha1.js");K=K.exports=E.pkcs1=E.pkcs1||{};K.encode_rsa_oaep=function(O,y,l){if(typeof l==="string"){var c=l;var a=arguments[3]||void 0;var b=arguments[4]||void 0}else if(l&&(c=l.label||void 0,a=l.seed||void 0,b=l.md||void 0,l.mgf1&&l.mgf1.md))var g=l.mgf1.md;b?b.start():b=E.md.sha1.create();g||(g=b);var u=Math.ceil(O.n.bitLength()/8),G=u-2*b.digestLength-2;if(y.length>G)throw g=Error("RSAES-OAEP input message length is too long."),
319g.length=y.length,g.maxLength=G,g;c||(c="");b.update(c,"raw");c=b.digest();var h="";G-=y.length;for(var B=0;B<G;B++)h+="\x00";G=c.getBytes()+h+"\u0001"+y;if(!a)a=E.random.getBytes(b.digestLength);else if(a.length!==b.digestLength)throw g=Error("Invalid RSAES-OAEP seed. The seed length must match the digest length."),g.seedLength=a.length,g.digestLength=b.digestLength,g;u=p(a,u-b.digestLength-1,g);u=E.util.xorBytes(G,u,G.length);b=p(u,b.digestLength,g);return"\x00"+E.util.xorBytes(a,b,a.length)+u};
320K.decode_rsa_oaep=function(O,y,l){if(typeof l==="string"){var c=l;var a=arguments[3]||void 0}else if(l&&(c=l.label||void 0,a=l.md||void 0,l.mgf1&&l.mgf1.md))var b=l.mgf1.md;var g=Math.ceil(O.n.bitLength()/8);if(y.length!==g){var u=Error("RSAES-OAEP encoded message length is invalid.");u.length=y.length;u.expectedLength=g;throw u;}a===void 0?a=E.md.sha1.create():a.start();b||(b=a);if(g<2*a.digestLength+2)throw Error("RSAES-OAEP key is too short for the hash function.");c||(c="");a.update(c,"raw");
321c=a.digest().getBytes();u=y.charAt(0);var G=y.substring(1,a.digestLength+1),h=y.substring(1+a.digestLength),B=p(h,a.digestLength,b);G=E.util.xorBytes(G,B,G.length);g=p(G,g-a.digestLength-1,b);g=E.util.xorBytes(h,g,h.length);b=g.substring(0,a.digestLength);u=u!=="\x00";for(h=0;h<a.digestLength;++h)u|=c.charAt(h)!==b.charAt(h);c=1;for(a=b=a.digestLength;a<g.length;a++)h=g.charCodeAt(a),G=h&1^1,u|=h&(c?65534:0),c&=G,b+=c;if(u||g.charCodeAt(b)!==1)throw Error("Invalid RSAES-OAEP padding.");return g.substring(b+
3221)}},
322"./lib/pkcs12.js":function(K,r,C){function p(d,q,A,D){for(var J=[],k=0;k<d.length;k++)for(var w=0;w<d[k].safeBags.length;w++){var f=d[k].safeBags[w];if(D===void 0||f.type===D)q===null?J.push(f):f.attributes[q]!==void 0&&f.attributes[q].indexOf(A)>=0&&J.push(f)}return J}function E(d){if(d.composed||d.constructed){for(var q=c.util.createBuffer(),A=0;A<d.value.length;++A)q.putBytes(d.value[A].value);d.composed=d.constructed=!1;d.value=q.getBytes()}return d}function O(d,q,A,D){q=a.fromDer(q,A);if(q.tagClass!==
323a.Class.UNIVERSAL||q.type!==a.Type.SEQUENCE||q.constructed!==!0)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var J=0;J<q.value.length;J++){var k={},w=[];if(!a.validate(q.value[J],u,k,w))throw d=Error("Cannot read ContentInfo."),d.errors=w,d;w={encrypted:!1};var f=k.content.value[0];switch(a.derToOid(k.contentType)){case b.oids.data:if(f.tagClass!==a.Class.UNIVERSAL||f.type!==a.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");
324k=E(f).value;break;case b.oids.encryptedData:var e=D;k={};var m=[];if(!a.validate(f,c.pkcs7.asn1.encryptedDataValidator,k,m))throw d=Error("Cannot read EncryptedContentInfo."),d.errors=m,d;f=a.derToOid(k.contentType);if(f!==b.oids.data)throw d=Error("PKCS#12 EncryptedContentInfo ContentType is not Data."),d.oid=f,d;f=a.derToOid(k.encAlgorithm);f=b.pbe.getCipher(f,k.encParameter,e);k=E(k.encryptedContentAsn1);k=c.util.createBuffer(k.value);f.update(k);if(!f.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");
325k=f.output.getBytes();w.encrypted=!0;break;default:throw d=Error("Unsupported PKCS#12 contentType."),d.contentType=a.derToOid(k.contentType),d;}w.safeBags=y(k,A,D);d.safeContents.push(w)}}function y(d,q,A){if(!q&&d.length===0)return[];d=a.fromDer(d,q);if(d.tagClass!==a.Class.UNIVERSAL||d.type!==a.Type.SEQUENCE||d.constructed!==!0)throw Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var D=[],J=0;J<d.value.length;J++){var k={},w=[];if(!a.validate(d.value[J],h,k,w))throw d=Error("Cannot read SafeBag."),
326d.errors=w,d;var f={type:a.derToOid(k.bagId),attributes:l(k.bagAttributes)};D.push(f);var e=k.bagValue.value[0];switch(f.type){case b.oids.pkcs8ShroudedKeyBag:if(e=b.decryptPrivateKeyInfo(e,A),e===null)throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case b.oids.keyBag:try{f.key=b.privateKeyFromAsn1(e)}catch(H){f.key=null,f.asn1=e}continue;case b.oids.certBag:var m=t;var x=function(){if(a.derToOid(k.certId)!==b.oids.x509Certificate){var H=Error("Unsupported certificate type, only X.509 supported.");
327H.oid=a.derToOid(k.certId);throw H;}H=a.fromDer(k.cert,q);try{f.cert=b.certificateFromAsn1(H,!0)}catch(L){f.cert=null,f.asn1=H}};break;default:throw d=Error("Unsupported PKCS#12 SafeBag type."),d.oid=f.type,d;}if(m!==void 0&&!a.validate(e,m,k,w))throw d=Error("Cannot read PKCS#12 "+m.name),d.errors=w,d;x()}return D}function l(d){var q={};if(d!==void 0)for(var A=0;A<d.length;++A){var D={},J=[];if(!a.validate(d[A],B,D,J))throw d=Error("Cannot read PKCS#12 BagAttribute."),d.errors=J,d;J=a.derToOid(D.oid);
328if(b.oids[J]!==void 0){q[b.oids[J]]=[];for(var k=0;k<D.values.length;++k)q[b.oids[J]].push(D.values[k].value)}}return q}var c=C("./lib/forge.js");C("./lib/asn1.js");C("./lib/hmac.js");C("./lib/oids.js");C("./lib/pkcs7asn1.js");C("./lib/pbe.js");C("./lib/random.js");C("./lib/rsa.js");C("./lib/sha1.js");C("./lib/util.js");C("./lib/x509.js");var a=c.asn1,b=c.pki,g=K.exports=c.pkcs12=c.pkcs12||{},u={name:"ContentInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",
329tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:a.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},G={name:"PFX",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"version"},u,{name:"PFX.macData",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",
330tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:a.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,
331constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,c
331onstructed:!1,optional:!0,capture:"macIterations"}]}]},h={name:"SafeBag",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:a.Class.CONTEXT_SPECIFIC,
332constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:a.Class.UNIVERSAL,type:a.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},B={name:"Attribute",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:a.Class.UNIVERSAL,type:a.Type.SET,constructed:!0,capture:"values"}]},t={name:"CertBag",tagClass:a.Class.UNIVERSAL,
333type:a.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:a.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:a.Class.UNIVERSAL,type:a.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};g.pkcs12FromAsn1=function(d,q,A){typeof q==="string"?(A=q,q=!0):q===void 0&&(q=!0);var D={};if(!a.validate(d,G,D,[]))throw q=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX."),
334q.errors=q,q;var J={version:D.version.charCodeAt(0),safeContents:[],getBags:function(m){var x={},H;"localKeyId"in m?H=m.localKeyId:"localKeyIdHex"in m&&(H=c.util.hexToBytes(m.localKeyIdHex));H===void 0&&!("friendlyName"in m)&&"bagType"in m&&(x[m.bagType]=p(J.safeContents,null,null,m.bagType));H!==void 0&&(x.localKeyId=p(J.safeContents,"localKeyId",H,m.bagType));"friendlyName"in m&&(x.friendlyName=p(J.safeContents,"friendlyName",m.friendlyName,m.bagType));return x},getBagsByFriendlyName:function(m,
335x){return p(J.safeContents,"friendlyName",m,x)},getBagsByLocalKeyId:function(m,x){return p(J.safeContents,"localKeyId",m,x)}};if(D.version.charCodeAt(0)!==3)throw q=Error("PKCS#12 PFX of version other than 3 not supported."),q.version=D.version.charCodeAt(0),q;if(a.derToOid(D.contentType)!==b.oids.data)throw q=Error("Only PKCS#12 PFX in password integrity mode supported."),q.oid=a.derToOid(D.contentType),q;var k=D.content.value[0];if(k.tagClass!==a.Class.UNIVERSAL||k.type!==a.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");
336k=E(k);if(D.mac){d=null;var w=0,f=a.derToOid(D.macAlgorithm);switch(f){case b.oids.sha1:d=c.md.sha1.create();w=20;break;case b.oids.sha256:d=c.md.sha256.create();w=32;break;case b.oids.sha384:d=c.md.sha384.create();w=48;break;case b.oids.sha512:d=c.md.sha512.create();w=64;break;case b.oids.md5:d=c.md.md5.create(),w=16}if(d===null)throw Error("PKCS#12 uses unsupported MAC algorithm: "+f);f=new c.util.ByteBuffer(D.macSalt);var e="macIterations"in D?parseInt(c.util.bytesToHex(D.macIterations),16):1;
337w=g.generateKey(A,f,3,e,w,d);f=c.hmac.create();f.start(d,w);f.update(k.value);if(f.getMac().getBytes()!==D.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?");}else if(Array.isArray(d.value)&&d.value.length>2)throw Error("Invalid PKCS#12. macData field present but MAC was not validated.");O(J,k.value,q,A);return J};g.toPkcs12Asn1=function(d,q,A,D){D=D||{};D.saltSize=D.saltSize||8;D.count=D.count||2048;D.algorithm=D.algorithm||D.encAlgorithm||"aes128";"useMac"in D||(D.useMac=
338!0);"localKeyId"in D||(D.localKeyId=null);"generateLocalKeyId"in D||(D.generateLocalKeyId=!0);var J=D.localKeyId,k;if(J!==null)J=c.util.hexToBytes(J);else if(D.generateLocalKeyId)if(q){var w=c.util.isArray(q)?q[0]:q;typeof w==="string"&&(w=b.certificateFromPem(w));J=c.md.sha1.create();J.update(a.toDer(b.certificateToAsn1(w)).getBytes());J=J.digest().getBytes()}else J=c.random.getBytes(20);w=[];J!==null&&w.push(a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,
339a.oidToDer(b.oids.localKeyId).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SET,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,J)])]));"friendlyName"in D&&w.push(a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(b.oids.friendlyName).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SET,!0,[a.create(a.Class.UNIVERSAL,a.Type.BMPSTRING,!1,D.friendlyName)])]));w.length>0&&(k=a.create(a.Class.UNIVERSAL,a.Type.SET,!0,w));J=[];w=[];q!==null&&(w=c.util.isArray(q)?
340q:[q]);for(var f=[],e=0;e<w.length;++e){q=w[e];typeof q==="string"&&(q=b.certificateFromPem(q));var m=e===0?k:void 0;q=b.certificateToAsn1(q);q=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(b.oids.certBag).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(b.oids.x509Certificate).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,
341a.Type.OCTETSTRING,!1,a.toDer(q).getBytes())])])]),m]);f.push(q)}f.length>0&&(q=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,f),q=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(b.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(q).getBytes())])]),J.push(q));d!==null&&(d=b.wrapRsaPrivateKey(b.privateKeyToAsn1(d)),d=A===null?a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,
342a.Type.OID,!1,a.oidToDer(b.oids.keyBag).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[d]),k]):a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(b.oids.pkcs8ShroudedKeyBag).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[b.encryptPrivateKeyInfo(d,A,D)]),k]),d=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[d]),d=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(b.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,
3430,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(d).getBytes())])]),J.push(d));k=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,J);if(D.useMac){J=c.md.sha1.create();var x=new c.util.ByteBuffer(c.random.getBytes(D.saltSize));D=D.count;d=g.generateKey(A,x,3,D,20);A=c.hmac.create();A.start(J,d);A.update(a.toDer(k).getBytes());A=A.getMac();x=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,
344a.Type.OID,!1,a.oidToDer(b.oids.sha1).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,A.getBytes())]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,x.getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(
344D).getBytes())])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(3).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,
345a.Type.OID,!1,a.oidToDer(b.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(k).getBytes())])]),x])};g.generateKey=c.pbe.generatePkcs12Key},
345"./lib/pkcs7.js":function(K,r,C){function p(a){if(a.type===y.pki.oids.contentType)var b=l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(a.value).getBytes());else if(a.type===y.pki.oids.messageDigest)b=l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,a.value.bytes());else if(a.type===y.pki.oids.signingTime){b=
346new Date("1950-01-01T00:00:00Z");var g=new Date("2050-01-01T00:00:00Z"),u=a.value;if(typeof u==="string"){var G=Date.parse(u);u=isNaN(G)?u.length===13?l.utcTimeToDate(u):l.generalizedTimeToDate(u):new Date(G)}b=u>=b&&u<g?l.create(l.Class.UNIVERSAL,l.Type.UTCTIME,!1,l.dateToUtcTime(u)):l.create(l.Class.UNIVERSAL,l.Type.GENERALIZEDTIME,!1,l.dateToGeneralizedTime(u))}return l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(a.type).getBytes()),l.create(l.Class.UNIVERSAL,
347l.Type.SET,!0,[b])])}function E(a,b,g){var u={};if(!l.validate(b,g,u,[]))throw a=Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message."),a.errors=a,a;if(l.derToOid(u.contentType)!==y.pki.oids.data)throw Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(u.encryptedContent){b="";if(y.util.isArray(u.encryptedContent))for(g=0;g<u.encryptedContent.length;++g){if(u.encryptedContent[g].type!==l.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");
348b+=u.encryptedContent[g].value}else b=u.encryptedContent;a.encryptedContent={algorithm:l.derToOid(u.encAlgorithm),parameter:y.util.createBuffer(u.encParameter.value),content:y.util.createBuffer(b)}}if(u.content){b="";if(y.util.isArray(u.content))for(g=0;g<u.content.length;++g){if(u.content[g].type!==l.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");b+=u.content[g].value}else b=u.content;a.content=y.util.createBuffer(b)}a.version=
349u.version.charCodeAt(0);return a.rawCapture=u}function O(a){if(a.encryptedContent.key===void 0)throw Error("Symmetric key not available.");if(a.content===void 0){switch(a.encryptedContent.algorithm){case y.pki.oids["aes128-CBC"]:case y.pki.oids["aes192-CBC"]:case y.pki.oids["aes256-CBC"]:var b=y.aes.createDecryptionCipher(a.encryptedContent.key);break;case y.pki.oids.desCBC:case y.pki.oids["des-EDE3-CBC"]:b=y.des.createDecryptionCipher(a.encryptedContent.key);break;default:throw Error("Unsupported symmetric cipher, OID "+
350a.encryptedContent.algorithm);}b.start(a.encryptedContent.parameter);b.update(a.encryptedContent.content);if(!b.finish())throw Error("Symmetric decryption failed.");a.content=b.output}}var y=C("./lib/forge.js");C("./lib/aes.js");C("./lib/asn1.js");C("./lib/des.js");C("./lib/oids.js");C("./lib/pem.js");C("./lib/pkcs7asn1.js");C("./lib/random.js");C("./lib/util.js");C("./lib/x509.js");var l=y.asn1,c=K.exports=y.pkcs7=y.pkcs7||{};c.messageFromPem=function(a){a=y.pem.decode(a)[0];if(a.type!=="PKCS7"){var b=
351Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');b.headerType=a.type;throw b;}if(a.procType&&a.procType.type==="ENCRYPTED")throw Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");a=l.fromDer(a.body);return c.messageFromAsn1(a)};c.messageToPem=function(a,b){a={type:"PKCS7",body:l.toDer(a.toAsn1()).getBytes()};return y.pem.encode(a,{maxline:b})};c.messageFromAsn1=function(a){var b={},g=[];if(!l.validate(a,c.asn1.contentInfoValidator,b,g))throw b=
352Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo."),b.errors=g,b;g=l.derToOid(b.contentType);switch(g){case y.pki.oids.envelopedData:g=c.createEnvelopedData();break;case y.pki.oids.encryptedData:g=c.createEncryptedData();break;case y.pki.oids.signedData:g=c.createSignedData();break;default:throw Error("Cannot read PKCS#7 message. ContentType with OID "+g+" is not (yet) supported.");}g.fromAsn1(b.content.value[0]);return g};c.createSignedData=function(){var a=null;return a=
353{type:y.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(b){E(a,b,c.asn1.signedDataValidator);a.certificates=[];a.crls=[];a.digestAlgorithmIdentifiers=[];a.contentInfo=null;a.signerInfos=[];if(a.rawCapture.certificates){b=a.rawCapture.certificates.value;for(var g=0;g<b.length;++g)a.certificates.push(y.pki.certificateFromAsn1(b[g]))}},toAsn1:function(){a.contentInfo||a.sign();for(var b=[],g=0;g<a.certificates.length;++g)b.push(y.pki.certificateToAsn1(a.certificates[g]));
354g=[];var u=l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(a.version).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SET,!0,a.digestAlgorithmIdentifiers),a.contentInfo]
354)]);b.length>0&&u.value[0].value.push(l.create(l.Class.CONTEXT_SPECIFIC,0,!0,b));g.length>0&&u.value[0].value.push(l.create(l.Class.CONTEXT_SPECIFIC,1,!0,g));u.value[0].value.push(l.create(l.Class.UNIVERSAL,l.Type.SET,!0,a.signerInfos));
355return l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(a.type).getBytes()),u])},addSigner:function(b){var g=b.issuer,u=b.serialNumber;b.certificate&&(u=b.certificate,typeof u==="string"&&(u=y.pki.certificateFromPem(u)),g=u.issuer.attributes,u=u.serialNumber);var G=b.key;if(!G)throw Error("Could not add PKCS#7 signer; no private key specified.");typeof G==="string"&&(G=y.pki.privateKeyFromPem(G));var h=b.digestAlgorithm||y.pki.oids.sha1;switch(h){case y.pki.oids.sha1:case y.pki.oids.sha256:case y.pki.oids.sha384:case y.pki.oids.sha512:case y.pki.oids.md5:break;
356default:throw Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+h);}b=b.authenticatedAttributes||[];if(b.length>0){for(var B=!1,t=!1,d=0;d<b.length;++d){var q=b[d];if(!B&&q.type===y.pki.oids.contentType){if(B=!0,t)break}else if(!t&&q.type===y.pki.oids.messageDigest&&(t=!0,B))break}if(!B||!t)throw Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.");
357}a.signers.push({key:G,version:1,issuer:g,serialNumber:u,digestAlgorithm:h,signatureAlgorithm:y.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:b,unauthenticatedAttributes:[]})},sign:function(b){b=b||{};if(typeof a.content!=="object"||a.contentInfo===null)if(a.contentInfo=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(y.pki.oids.data).getBytes())]),"content"in a){var g;a.content instanceof y.util.ByteBuffer?g=a.content.bytes():typeof a.content===
358"string"&&(g=y.util.encodeUtf8(a.content));b.detached?a.detachedContent=l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,g):a.contentInfo.value.push(l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,g)]))}if(a.signers.length!==0){b={};for(g=0;g<a.signers.length;++g){var u=a.signers[g],G=u.digestAlgorithm;G in b||(b[G]=y.md[y.pki.oids[G]].create());u.md=u.authenticatedAttributes.length===0?b[G]:y.md[y.pki.oids[G]].create()}a.digestAlgorithmIdentifiers=[];for(G in b)a.digestAlgorithmIdentifiers.push(l.create(l.Class.UNIVERSAL,
359l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(G).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.NULL,!1,"")]));a.detachedContent?g=a.detachedContent:(g=a.contentInfo.value[1],g=g.value[0]);if(!g)throw Error("Could not sign PKCS#7 message; there is no content to sign.");G=l.derToOid(a.contentInfo.value[0].value);var h=l.toDer(g);h.getByte();l.getBerValueLength(h);h=h.getBytes();for(var B in b)b[B].start().update(h);B=new Date;for(g=0;g<a.signers.length;++g){u=a.signers[g];
360if(u.authenticatedAttributes.length===0){if(G!==y.pki.oids.data)throw Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.");}else{u.authenticatedAttributesAsn1=l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[]);h=l.create(l.Class.UNIVERSAL,l.Type.SET,!0,[]);for(var t=0;t<u.authenticatedAttributes.length;++t){var d=u.authenticatedAttributes[t];d.type===y.pki.oids.messageDigest?d.value=b[u.digestAlgorithm].digest():d.type!==y.pki.oids.signingTime||
361d.value||(d.value=B);h.value.push(p(d));u.authenticatedAttributesAsn1.value.push(p(d))}h=l.toDer(h).getBytes();u.md.start().update(h)}u.signature=u.key.sign(u.md,"RSASSA-PKCS1-V1_5")}b=a;G=a.signers;B=[];for(g=0;g<G.length;++g){u=B;h=u.push;t=G[g];d=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(t.version).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[y.pki.distinguishedNameToAsn1({attributes:t.issuer}),l.create(l.Class.UNIVERSAL,
362l.Type.INTEGER,!1,y.util.hexToBytes(t.serialNumber))]),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(t.digestAlgorithm).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.NULL,!1,"")])]);t.authenticatedAttributesAsn1&&d.value.push(t.authenticatedAttributesAsn1);d.value.push(l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(t.signatureAlgorithm).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.NULL,!1,"")]));
363d.value.push(l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,t.signature));if(t.unauthenticatedAttributes.length>0){for(var q=l.create(l.Class.CONTEXT_SPECIFIC,1,!0,[]),A=0;A<t.unauthenticatedAttributes.length;++A)q.values.push(p(t.unauthenticatedAttributes[A]));d.value.push(q)}h.call(u,d)}b.signerInfos=B}},verify:function(){throw Error("PKCS#7 signature verification not yet implemented.");},addCertificate:function(b){typeof b==="string"&&(b=y.pki.certificateFromPem(b));a.certificates.push(b)},addCertificateRevokationList:function(b){throw Error("PKCS#7 CRL support not yet implemented.");
364}}};c.createEncryptedData=function(){var a=null;return a={type:y.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:y.pki.oids["aes256-CBC"]},fromAsn1:function(b){E(a,b,c.asn1.encryptedDataValidator)},decrypt:function(b){b!==void 0&&(a.encryptedContent.key=b);O(a)}}};c.createEnvelopedData=function(){var a=null;return a={type:y.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:y.pki.oids["aes256-CBC"]},fromAsn1:function(b){var g=E(a,b,c.asn1.envelopedDataValidator);
365b=a;g=g.recipientInfos.value;for(var u=[],G=0;G<g.length;++G){var h=u,B=h.push,t={};var d=[];if(!l.validate(g[G],c.asn1.recipientInfoValidator,t,d))throw b=Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo."),b.errors=d,b;d={version:t.version.charCodeAt(0),issuer:y.pki.RDNAttributesAsArray(t.issuer),serialNumber:y.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:l.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}};
366B.call(h,d)}b.recipients=u},toAsn1:function(){for(var b=l,g=b.create,u=l.Class.UNIVERSAL,G=l.Type.SEQUENCE,h=l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(a.type).getBytes()),B=l,t=B.create,d=l.Class.CONTEXT_SPECIFIC,q=l,A=q.create,D=l.Class.UNIVERSAL,J=l.Type.SEQUENCE,k=l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(a.version).getBytes()),w=l,f=w.create,e=l.Class.UNIVERSAL,m=l.Type.SET,x=a.recipients,H=[],L=0;L<x.length;++L){var P=H,Q=P.push;var S=x[L];
366S=l.create(l.Class.UNIVERSAL,
367l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(S.version).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[y.pki.distinguishedNameToAsn1({attributes:S.issuer}),l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,y.util.hexToBytes(S.serialNumber))]),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(S.encryptedContent.algorithm).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.NULL,!1,"")]),l.create(l.Class.UNIVERSAL,
368l.Type.OCTETSTRING,!1,S.encryptedContent.content)]);Q.call(P,S)}w=f.call(w,e,m,!0,H);f=l;e=f.create;m=l.Class.UNIVERSAL;x=l.Type.SEQUENCE;H=a.encryptedContent;H=[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(y.pki.oids.data).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(H.algorithm).getBytes()),H.parameter?l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,H.parameter.getBytes()):void 0]),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,
369l.Type.OCTETSTRING,!1,H.content.getBytes())])];return g.call(b,u,G,!0,[h,t.call(B,d,0,!0,[A.call(q,D,J,!0,[k,w,e.call(f,m,x,!0,H)])])])},findRecipient:function(b){for(var g=b.issuer.attributes,u=0;u<a.recipients.length;++u){var G=a.recipients[u],h=G.issuer;if(G.serialNumber===b.serialNumber&&h.length===g.length){for(var B=!0,t=0;t<g.length;++t)if(h[t].type!==g[t].type||h[t].value!==g[t].value){B=!1;break}if(B)return G}}return null},decrypt:function(b,g){if(a.encryptedContent.key===void 0&&b!==void 0&&
370g!==void 0)switch(b.encryptedContent.algorithm){case y.pki.oids.rsaEncryption:case y.pki.oids.desCBC:b=g.decrypt(b.encryptedContent.content);a.encryptedContent.key=y.util.createBuffer(b);break;default:throw Error("Unsupported asymmetric cipher, OID "+b.encryptedContent.algorithm);}O(a)},addRecipient:function(b){a.recipients.push({version:0,issuer:b.issuer.attributes,serialNumber:b.serialNumber,encryptedContent:{algorithm:y.pki.oids.rsaEncryption,key:b.publicKey}})},encrypt:function(b,g){if(a.encryptedContent.content===
371void 0){g=g||a.encryptedContent.algorithm;b=b||a.encryptedContent.key;var u;switch(g){case y.pki.oids["aes128-CBC"]:var G=u=16;var h=y.aes.createEncryptionCipher;break;case y.pki.oids["aes192-CBC"]:u=24;G=16;h=y.aes.createEncryptionCipher;break;case y.pki.oids["aes256-CBC"]:u=32;G=16;h=y.aes.createEncryptionCipher;break;case y.pki.oids["des-EDE3-CBC"]:u=24;G=8;h=y.des.createEncryptionCipher;break;default:throw Error("Unsupported symmetric cipher, OID "+g);}if(b===void 0)b=y.util.createBuffer(y.random.getBytes(u));
372else if(b.length()!=u)throw Error("Symmetric key has wrong length; got "+b.length()+" bytes, expected "+u+".");a.encryptedContent.algorithm=g;a.encryptedContent.key=b;a.encryptedContent.parameter=y.util.createBuffer(y.random.getBytes(G));b=h(b);b.start(a.encryptedContent.parameter.copy());b.update(a.content);if(!b.finish())throw Error("Symmetric encryption failed.");a.encryptedContent.content=b.output}for(b=0;b<a.recipients.length;++b)if(g=a.recipients[b],g.encryptedContent.content===void 0)switch(g.encryptedContent.algorithm){case y.pki.oids.rsaEncryption:g.encryptedContent.content=
373g.encryptedContent.key.encrypt(a.encryptedContent.key.data);break;default:throw Error("Unsupported asymmetric cipher, OID "+g.encryptedContent.algorithm);}}}}},
373"./lib/pkcs7asn1.js":function(K,r,C){r=C("./lib/forge.js");C("./lib/asn1.js");C("./lib/util.js");C=r.asn1;K=K.exports=r.pkcs7asn1=r.pkcs7asn1||{};r.pkcs7=r.pkcs7||{};r.pkcs7.asn1=K;r={name:"ContentInfo",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,
374constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:C.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};K.contentInfoValidator=r;var p={name:"EncryptedContentInfo",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,
375constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:C.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:C.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};K.envelopedDataValidator={name:"EnvelopedData",tagClass:C.Class.UNIVERSAL,
376type:C.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:C.Class.UNIVERSAL,type:C.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(p)};K.encryptedDataValidator={name:"EncryptedData",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,capture:"version"}].concat(p)};
377K.signedDataValidator={name:"SignedData",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:C.Class.UNIVERSAL,type:C.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},r,{name:"SignedData.Certificates",tagClass:C.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",
378tagClass:C.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:C.Class.UNIVERSAL,type:C.Type.SET,capture:"signerInfos",optional:!0,value:[{name:"SignerInfo",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",
379tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",
380tagClass:C.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:C.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:C.Class.UNIVERSAL,type:C.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",
381tagClass:C.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]}]}]};K.recipientInfoValidator={name:"RecipientInfo",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,c
381onstructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:C.Class.UNIVERSAL,
382type:C.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:C.Class.UNIVERSAL,
383type:C.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:C.Class.UNIVERSAL,type:C.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},
383"./lib/pki.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/asn1.js");C("./lib/oids.js");C("./lib/pbe.js");C("./lib/pem.js");C("./lib/pbkdf2.js");C("./lib/pkcs12.js");C("./lib/pss.js");C("./lib/rsa.js");C("./lib/util.js");C("./lib/x509.js");var E=p.asn1,O=K.exports=p.pki=p.pki||{};O.pemToDer=function(y){y=
384p.pem.decode(y)[0];if(y.procType&&y.procType.type==="ENCRYPTED")throw Error("Could not convert PEM to DER; PEM is encrypted.");return p.util.createBuffer(y.body)};O.privateKeyFromPem=function(y){y=p.pem.decode(y)[0];if(y.type!=="PRIVATE KEY"&&y.type!=="RSA PRIVATE KEY"){var l=Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');l.headerType=y.type;throw l;}if(y.procType&&y.procType.type==="ENCRYPTED")throw Error("Could not convert private key from PEM; PEM is encrypted.");
385y=E.fromDer(y.body);return O.privateKeyFromAsn1(y)};O.privateKeyToPem=function(y,l){y={type:"RSA PRIVATE KEY",body:E.toDer(O.privateKeyToAsn1(y)).getBytes()};return p.pem.encode(y,{maxline:l})};O.privateKeyInfoToPem=function(y,l){y={type:"PRIVATE KEY",body:E.toDer(y).getBytes()};return p.pem.encode(y,{maxline:l})}},
385"./lib/prime.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/util.js");C("./lib/jsbn.js");C("./lib/random.js");(function(){function E(h,B,t,d){return"workers"in t?l(h,B,t,d):O(h,
386B,t,d)}function O(h,B,t,d){var q=c(h,B);var A=q.bitLength();A=A<=100?27:A<=150?18:A<=200?15:A<=250?12:A<=300?9:A<=350?8:A<=400?7:A<=500?6:A<=600?5:A<=800?4:A<=1250?3:2;"millerRabinTests"in t&&(A=t.millerRabinTests);var D=10;"maxBlockTime"in t&&(D=t.maxBlockTime);y(q,h,B,0,A,D,d)}function y(h,B,t,d,q,A,D){var J=+new Date;do{h.bitLength()>B&&(h=c(B,t));if(h.isProbablePrime(q))return D(null,h);h.dAddOffset(g[d++%8],0)}while(A<0||+new Date-J<A);p.util.setImmediate(function(){y(h,B,t,d,q,A,D)})}function l(h,
387B,t,d){function q(){function f(L){if(!H){--x;var P=L.data;if(P.found){for(L=0;L<e.length;++L)e[L].terminate();H=!0;return d(null,new b(P.prime,16))}A.bitLength()>h&&(A=c(h,B));L.target.postMessage({hex:A.toString(16),workLoad:J});A.dAddOffset(k,0)}}D=Math.max(1,D);for(var e=[],m=0;m<D;++m)e[m]=new Worker(w);var x=D;for(m=0;m<D;++m)e[m].addEventListener("message",f);var H=!1}if(typeof Worker==="undefined")return O(h,B,t,d);var A=c(h,B),D=t.workers,J=t.workLoad||100,k=J*30/8,w=t.workerScript||"forge/prime.worker.js";
388if(D===-1)return p.util.estimateCores(function(f,e){f&&(e=2);D=e-1;q()});q()}function c(h,B){B=new b(h,B);--h;B.testBit(h)||B.bitwiseTo(b.ONE.shiftLeft(h),G,B);B.dAddOffset(31-B.mod(u).byteValue(),0);return B}if(p.prime)K.exports=p.prime;else{var a=K.exports=p.prime=p.prime||{},b=p.jsbn.BigInteger,g=[6,4,2,4,2,4,6,2],u=new b(null);u.fromInt(30);var G=function(h,B){return h|B};a.generateProbablePrime=function(h,B,t){typeof B==="function"&&(t=B,B={});B=B||{};var d=B.algorithm||"PRIMEINC";typeof d===
389"string"&&(d={name:d});d.options=d.options||{};var q=B.prng||p.random;B={nextBytes:function(A){for(var D=q.getBytesSync(A.length),J=0;J<A.length;++J)A[J]=D.charCodeAt(J)}};if(d.name==="PRIMEINC")return E(h,B,d.options,t);throw Error("Invalid prime generation algorithm: "+d.name);}}})()},
389"./lib/prng.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/util.js");var E=null;!p.util.isNodejs||p.options.usePureJavaScript||process.versions["node-webkit"]||(E=C(1));(K.exports=p.prng=p.prng||{}).create=
390function(O){function y(u){if(a.pools[0].messageLength>=32)return l(),u();a.seedFile(32-a.pools[0].messageLength<<5,function(G,h){if(G)return u(G);a.collect(h);l();u()})}function l(){a.reseeds=a.reseeds===4294967295?0:a.reseeds+1;var u=a.plugin.md.create();u.update(a.keyBytes);for(var G=1,h=0;h<32;++h)a.reseeds%G===0&&(u.update(a.pools[h].digest().getBytes()),a.pools[h].start()),G<<=1;a.keyBytes=u.digest().getBytes();u.start();u.update(a.keyBytes);u=u.digest().getBytes();a.key=a.plugin.formatKey(a.keyBytes);
391a.seed=a.plugin.formatSeed(u);a.generated=0}function c(u){var G=null,h=p.util.globalScope,B=h.crypto||h.msCrypto;B&&B.getRandomValues&&(G=function(q){return B.getRandomValues(q)});h=p.util.createBuffer();if(G)for(;h.length()<u;){var t=Math.max(1,Math.min(u-h.length(),65536)/4),d=new Uint32Array(Math.floor(t));try{for(G(d),t=0;t<d.length;++t)h.putInt32(d[t])}catch(q){if(!(typeof QuotaExceededError!=="undefined"&&q instanceof QuotaExceededError))throw q;}}if(h.length()<u)for(G=Math.floor(Math.random()*
39265536);h.length()<u;)for(t=16807*(G&65535),G=16807*(G>>16),t+=(G&32767)<<16,t+=G>>15,t=(t&2147483647)+(t>>31),G=t&4294967295,t=0;t<3;++t)d=G>>>(t<<3),d^=Math.floor(Math.random()*256),h.putByte(d&255);return h.getBytes(u)}var a={plugin:O,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""};O=O.md;for(var b=Array(32),g=0;g<32;++g)b[g]=O.create();a.pools=b;a.pool=0;a.generate=function(u,G){function h(D){if(D)return G(D);if(A.length()>=u)return G(null,A.getBytes(u));a.generated>1048575&&(a.key=
393null);if(a.key===null)return p.util.nextTick(function(){y(h)});D=B(a.key,a.seed);a.generated+=D.length;A.putBytes(D);a.key=d(B(a.key,t(a.seed)));a.seed=q(B(a.key,a.seed));p.util.setImmediate(h)}if(!G)return a.generateSync(u);var B=a.plugin.cipher,t=a.plugin.increment,d=a.plugin.formatKey,q=a.plugin.formatSeed,A=p.util.createBuffer();a.key=null;h()};a.generateSync=function(u){var G=a.plugin.cipher,h=a.plugin.increment,B=a.plugin.formatKey,t=a.plugin.formatSeed;a.key=null;for(var d=p.util.createBuffer();d.length()<
394u;){a.generated>1048575&&(a.key=null);a.key===null&&(a.pools[0].messageLength>=32||a.collect(a.seedFileSync(32-a.pools[0].messageLength<<5)),l());var q=G(a.key,a.seed);a.generated+=q.length;d.putBytes(q);a.key=B(G(a.key,h(a.seed)));a.seed=t(G(a.key,a.seed))}return d.getBytes(u)};E?(a.seedFile=function(u,G){E.randomBytes(u,function(h,B){if(h)return G(h);G(null,B.toString())})},a.seedFileSync=function(u){return E.randomBytes(u).toString()}):(a.seedFile=function(u,G){try{G(null,c(u))}catch(h){G(h)}},
395a.seedFileSync=c);a.collect=function(u){for(var G=u.length,h=0;h<G;++h)a.pools[a.pool].update(u.substr(h,1)),a.pool=a.pool===31?0:a.pool+1};a.collectInt=function(u,G){for(var h="",B=0;B<G;B+=8)h+=String.fromCharCode(u>>B&255);a.collect(h)};a.registerWorker=function(u){u===self?a.seedFile=function(G,h){function B(t){t=t.data;t.forge&&t.forge.prng&&(self.removeEventListener("message",B),h(t.forge.prng.err,t.forge.prng.bytes))}self.addEventListener("message",B);self.postMessage({forge:{prng:{needed:G}}})}:
396u.addEventListener("message",function(G){G=G.data;G.forge&&G.forge.prng&&a.seedFile(G.forge.prng.needed,function(h,B){u.postMessage({forge:{prng:{err:h,bytes:B}}})})})};return a}},
396"./lib/pss.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/random.js");C("./lib/util.js");(K.exports=p.pss=p.pss||{}).create=function(E){arguments.length===3&&(E={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var O=E.md,y=E.mgf,l=O.digestLength,c=E.salt||null;typeof c==="string"&&(c=p.util.createBuffer(c));
397if("saltLength"in E)var a=E.saltLength;else if(c!==null)a=c.length();else throw Error("Salt length not specified or specific salt not given.");if(c!==null&&c.length()!==a)throw Error("Given salt length does not match length of given salt.");var b=E.prng||p.random;return{encode:function(g,u){--u;var G=Math.ceil(u/8);g=g.digest().getBytes();if(G<l+a+2)throw Error("Message is too long to encrypt.");var h=c===null?b.getBytesSync(a):c.bytes();var B=new p.util.ByteBuffer;B.fillWithByte(0,8);B.putBytes(g);
398B.putBytes(h);O.start();O.update(B.getBytes());g=O.digest().getBytes();B=new p.util.ByteBuffer;B.fillWithByte(0,G-a-l-2);B.putByte(1);B.putBytes(h);var t=B.getBytes(),d=G-l-1,q=y.generate(g,d);h="";for(B=0;B<d;B++)h+=String.fromCharCode(t.charCodeAt(B)^q.charCodeAt(B));u=65280>>8*G-u&255;h=String.fromCharCode(h.charCodeAt(0)&~u)+h.substr(1);return h+g+String.fromCharCode(188)},verify:function(g,u,G){var h=G-1;G=Math.ceil(h/8);u=u.substr(-G);if(G<l+a+2)throw Error("Inconsistent parameters to PSS signature verification.");
399if(u.charCodeAt(G-1)!==188)throw Error("Encoded message does not end in 0xBC.");var B=G-l-1,t=u.substr(0,B);u=u.substr(B,l);var d=65280>>8*G-h&255;if((t.charCodeAt(0)&d)!==0)throw Error("Bits beyond keysize not zero as expected.");var q=y.generate(u,B),A="";for(h=0;h<B;h++)A+=String.fromCharCode(t.charCodeAt(h)^q.charCodeAt(h));A=String.fromCharCode(A.charCodeAt(0)&~d)+A.substr(1);G=G-l-a-2;for(h=0;h<G;h++)if(A.charCodeAt(h)!==0)throw Error("Leftmost octets not zero as expected");if(A.charCodeAt(G)!==
4001)throw Error("Inconsistent PSS signature, 0x01 marker not found");G=A.substr(-a);B=new p.util.ByteBuffer;B.fillWithByte(0,8);B.putBytes(g);B.putBytes(G);O.start();O.update(B.getBytes());g=O.digest().getBytes();return u===g}}}},
400"./lib/random.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/aes.js");C("./lib/sha256.js");C("./lib/prng.js");C("./lib/util.js");(function(){p.random&&p.random.getBytes?K.exports=p.random:function(E){function O(){var h=p.prng.create(y);h.getBytes=function(B,t){return h.generate(B,
401t)};h.getBytesSync=function(B){return h.generate(B)};return h}var y={},l=Array(4),c=p.util.createBuffer();y.formatKey=function(h){var B=p.util.createBuffer(h);h=Array(4);h[0]=B.getInt32();h[1]=B.getInt32();h[2]=B.getInt32();h[3]=B.getInt32();return p.aes._expandKey(h,!1)};y.formatSeed=function(h){var B=p.util.createBuffer(h);h=Array(4);h[0]=B.getInt32();h[1]=B.getInt32();h[2]=B.getInt32();h[3]=B.getInt32();return h};y.cipher=function(h,B){p.aes._updateBlock(h,B,l,!1);c.putInt32(l[0]);c.putInt32(l[1]);
402c.putInt32(l[2]);c.putInt32(l[3]);return c.getBytes()};y.increment=function(h){++h[3];return h};y.md=p.md.sha256;var a=O(),b=null,g=p.util.globalScope,u=g.crypto||g.msCrypto;u&&u.getRandomValues&&(b=function(h){return u.getRandomValues(h)});if(p.options.usePureJavaScript||!p.util.isNodejs&&!b){a.collectInt(+new Date,32);if(typeof navigator!=="undefined"){b="";
402for(var G in navigator)try{typeof navigator[G]=="string"&&(b+=navigator[G])}catch(h){}a.collect(b);b=null}E&&(E().mousemove(function(h){a.collectInt(h.clientX,
40316);a.collectInt(h.clientY,16)}),E().keypress(function(h){a.collectInt(h.charCode,8)}))}if(p.random)for(G in a)p.random[G]=a[G];else p.random=a;p.random.createInstance=O;K.exports=p.random}(typeof jQuery!=="undefined"?jQuery:null)})()},
403"./lib/rc2.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/util.js");var E=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,
40464,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,
40545,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],O=[1,2,3,5];K.exports=p.rc2=p.rc2||{};p.rc2.expandKey=function(l,c){typeof l==="string"&&(l=p.util.createBuffer(l));c=c||128;var a=l;l=l.length();var b=c;c=Math.ceil(b/8);b=255>>(b&7);var g;for(g=l;g<128;g++)a.putByte(E[a.at(g-1)+a.at(g-l)&255]);a.setAt(128-c,E[a.at(128-
406c)&b]);for(g=127-c;g>=0;g--)a.setAt(g,E[a.at(g+1)^a.at(g+c)]);return a};var y=function(l,c,a){var b=!1,g=null,u=null,G=null,h,B,t=[];l=p.rc2.expandKey(l,c);for(h=0;h<64;h++)t.push(l.getInt16Le());if(a){var d=function(D){for(h=0;h<4;h++){D[h]+=t[B]+(D[(h+3)%4]&D[(h+2)%4])+(~D[(h+3)%4]&D[(h+1)%4]);var J=D[h],k=O[h];D[h]=J<<k&65535|(J&65535)>>16-k;B++}};var q=function(D){for(h=0;h<4;h++)D[h]+=t[D[(h+3)%4]&63]}}else d=function(D){for(h=3;h>=0;h--){var J=D[h],k=O[h];D[h]=(J&65535)>>k|J<<16-k&65535;D[h]-=
407t[B]+(D[(h+3)%4]&D[(h+2)%4])+(~D[(h+3)%4]&D[(h+1)%4]);B--}},q=function(D){for(h=3;h>=0;h--)D[h]-=t[D[(h+3)%4]&63]};var A=null;return A={start:function(D,J){D&&typeof D==="string"&&(D=p.util.createBuffer(D));b=!1;g=p.util.createBuffer();u=J||new p.util.createBuffer;G=D;A.output=u},update:function(D){for(b||g.putBuffer(D);g.length()>=8;){D=[[5,d],[1,q],[6,d],[1,q],[5,d]];var J=[];for(h=0;h<4;h++){var k=g.getInt16Le();G!==null&&(a?k^=G.getInt16Le():G.putInt16Le(k));J.push(k&65535)}B=a?0:63;for(k=0;k<
408D.length;k++)for(var w=0;w<D[k][0];w++)D[k][1](J);for(h=0;h<4;h++)G!==null&&(a?G.putInt16Le(J[h]):J[h]^=G.getInt16Le()),u.putInt16Le(J[h])}},finish:function(D){var J=!0;if(a)if(D)J=D(8,g,!a);else{var k=g.length()===8?8:8-g.length();g.fillWithByte(k,k)}J&&(b=!0,A.update());!a&&(J=g.length()===0)&&(D?J=D(8,u,!a):(D=u.length(),k=u.at(D-1),k>D?J=!1:u.truncate(k)));return J}}};p.rc2.startEncrypting=function(l,c,a){l=p.rc2.createEncryptionCipher(l,128);l.start(c,a);return l};p.rc2.createEncryptionCipher=
409function(l,c){return y(l,c,!0)};p.rc2.startDecrypting=function(l,c,a){l=p.rc2.createDecryptionCipher(l,128);l.start(c,a);return l};p.rc2.createDecryptionCipher=function(l,c){return y(l,c,!1)}},
409"./lib/rsa.js":function(K,r,C){function p(e,m,x){var H=g.util.createBuffer();m=Math.ceil(m.n.bitLength()/8);if(e.length>m-11)throw H=Error("Message is too long for PKCS#1 v1.5 padding."),H.length=e.length,H.max=m-11,H;H.putByte(0);H.putByte(x);m=m-3-e.length;if(x===0||x===1){x=x===0?0:255;for(var L=0;L<m;++L)H.putByte(x)}else for(;m>
4100;){var P=0,Q=g.random.getBytes(m);for(L=0;L<m;++L)x=Q.charCodeAt(L),x===0?++P:H.putByte(x);m=P}H.putByte(0);H.putBytes(e);return H}function E(e,m,x,H,L){m=Math.ceil(m.n.bitLength()/8);e=g.util.createBuffer(e);var P=e.getByte(),Q=e.getByte();if(P!==0||x&&Q!==0&&Q!==1||!x&&Q!==2||x&&Q===0&&typeof H==="undefined")throw Error("Encryption block is invalid.");x=0;if(Q===0)for(x=m-3-H,H=0;H<x;++H){if(e.getByte()!==0)throw Error("Encryption block is invalid.");}else if(Q===1){for(x=0;e.length()>1;){if(e.getByte()!==
411255){--e.read;break}++x}if(x<8&&(!L||!L._skipPaddingChecks))throw Error("Encryption block is invalid.");}else if(Q===2){for(x=0;e.length()>1;){if(e.getByte()===0){--e.read;break}++x}if(x<8&&(!L||!L._skipPaddingChecks))throw Error("Encryption block is invalid.");}if(e.getByte()!==0||x!==m-3-e.length())throw Error("Encryption block is invalid.");return e.getBytes()}function O(e,m,x){function H(){L(e.pBits,function(S,V){if(S)return x(S);e.p=V;if(e.q!==null)return P(S,e.q);L(e.qBits,P)})}function L(S,
412V){g.prime.generateProbablePrime(S,Q,V)}function P(S,V){if(S)return x(S);e.q=V;e.p.compareTo(e.q)<0&&(S=e.p,e.p=e.q,e.q=S);e.p.subtract(u.ONE).gcd(e.e).compareTo(u.ONE)!==0?(e.p=null,H()):e.q.subtract(u.ONE).gcd(e.e).compareTo(u.ONE)!==0?(e.q=null,L(e.qBits,P)):(e.p1=e.p.subtract(u.ONE),e.q1=e.q.subtract(u.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(u.ONE)!==0?(e.p=e.q=null,H()):(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits?(e.q=null,L(e.qBits,P)):(S=e.e.modInverse(e.phi),e.keys={privateKey:t.rsa.setPrivateKey(e.n,
413e.e,S,e.p,e.q,S.mod(e.p1),S.mod(e.q1),e.q.modInverse(e.p)),publicKey:t.rsa.setPublicKey(e.n,e.e)},x(null,e.keys))))}typeof m==="function"&&(x=m,m={});m=m||{};var Q={algorithm:{name:m.algorithm||"PRIMEINC",options:{workers:m.workers||2,workLoad:m.workLoad||100,workerScript:m.workerScript}}};"prng"in m&&(Q.prng=m.prng);H()}function y(e){e=e.toString(16);e[0]>="8"&&(e="00"+e);e=g.util.hexToBytes(e);return e.length>1&&(e.charCodeAt(0)===0&&(e.charCodeAt(1)&128)===0||e.charCodeAt(0)===255&&(e.charCodeAt(1)&
414128)===128)?e.substr(1):e}function l(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function c(e){return typeof B.globalScope!=="undefined"&&typeof B.globalScope.crypto==="object"&&typeof B.globalScope.crypto.subtle==="object"&&typeof B.globalScope.crypto.subtle[e]==="function"}function a(e){return typeof B.globalScope!=="undefined"&&typeof B.globalScope.msCrypto==="object"&&typeof B.globalScope.msCrypto.subtle==="object"&&typeof B.globalScope.msCrypto.subtle[e]===
415"function"}function b(e){e=g.util.hexToBytes(e.toString(16));for(var m=new Uint8Array(e.length),x=0;x<e.length;++x)m[x]=e.charCodeAt(x);return m}var g=C("./lib/forge.js");C("./lib/asn1.js");C("./lib/jsbn.js");C("./lib/oids.js");C("./lib/pkcs1.js");C("./lib/prime.js");C("./lib/random.js");C("./lib/util.js");if(typeof u==="undefined")var u=g.jsbn.BigInteger;var G=g.util.isNodejs?C(1):null,h=g.asn1,B=g.util;g.pki=g.pki||{};K.exports=g.pki.rsa=g.rsa=g.rsa||{};var t=g.pki,d=[6,4,2,4,2,4,6,2],q={name:"PrivateKeyInfo",
416tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.OCTETSTRING,
417constructed:!1,capture:"privateKey"}]},A={name:"RSAPrivateKey",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,c
417onstructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},
418{name:"RSAPrivateKey.privateExponent",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",
419tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},D={name:"RSAPublicKey",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,
420constructed:!1,capture:"publicKeyExponent"}]},J=g.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:h.Class.UNIVERSAL,
421type:h.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},k={name:"DigestInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,
422constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:h.Class.UNIVERSAL,type:h.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:h.Class.UNIVERSAL,type:h.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},w=function(e){if(e.algorithm in t.oids)var m=t.oids[e.algorithm];else throw m=Error("Unknown message digest algorithm."),m.algorithm=e.algorithm,m;var x=h.oidToDer(m).getBytes();m=h.create(h.Class.UNIVERSAL,
423h.Type.SEQUENCE,!0,[]);var H=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);H.value.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,x));H.value.push(h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,""));e=h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,e.digest().getBytes());m.value.push(H);m.value.push(e);return h.toDer(m).getBytes()},f=function(e,m,x){if(x)return e.modPow(m.e,m.n);if(!m.p||!m.q)return e.modPow(m.d,m.n);m.dP||(m.dP=m.d.mod(m.p.subtract(u.ONE)));m.dQ||(m.dQ=m.d.mod(m.q.subtract(u.ONE)));
424m.qInv||(m.qInv=m.q.modInverse(m.p));do x=new u(g.util.bytesToHex(g.random.getBytes(m.n.bitLength()/8)),16);while(x.compareTo(m.n)>=0||!x.gcd(m.n).equals(u.ONE));e=e.multiply(x.modPow(m.e,m.n)).mod(m.n);var H=e.mod(m.p).modPow(m.dP,m.p);for(e=e.mod(m.q).modPow(m.dQ,m.q);H.compareTo(e)<0;)H=H.add(m.p);e=H.subtract(e).multiply(m.qInv).mod(m.p).multiply(m.q).add(e);return e=e.multiply(x.modInverse(m.n)).mod(m.n)};t.rsa.encrypt=function(e,m,x){var H=x,L=Math.ceil(m.n.bitLength()/8);x!==!1&&x!==!0?(H=
425x===2,x=p(e,m,x)):(x=g.util.createBuffer(),x.putBytes(e));e=new u(x.toHex(),16);m=f(e,m,H).toString(16);H=g.util.createBuffer();for(L-=Math.ceil(m.length/2);L>0;)H.putByte(0),--L;H.putBytes(g.util.hexToBytes(m));return H.getBytes()};t.rsa.decrypt=function(e,m,x,H){var L=Math.ceil(m.n.bitLength()/8);if(e.length!==L)throw m=Error("Encrypted message length is invali
425d."),m.length=e.length,m.expected=L,m;e=new u(g.util.createBuffer(e).toHex(),16);if(e.compareTo(m.n)>=0)throw Error("Encrypted message is invalid.");
426e=f(e,m,x).toString(16);var P=g.util.createBuffer();for(L-=Math.ceil(e.length/2);L>0;)P.putByte(0),--L;P.putBytes(g.util.hexToBytes(e));return H!==!1?E(P.getBytes(),m,x):P.getBytes()};t.rsa.createKeyPairGenerationState=function(e,m,x){typeof e==="string"&&(e=parseInt(e,10));e=e||2048;x=x||{};var H=x.prng||g.random,L={nextBytes:function(P){for(var Q=H.getBytesSync(P.length),S=0;S<P.length;++S)P[S]=Q.charCodeAt(S)}};x=x.algorithm||"PRIMEINC";if(x==="PRIMEINC")e={algorithm:x,state:0,bits:e,rng:L,eInt:m||
42765537,e:new u(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},e.e.fromInt(e.eInt);else throw Error("Invalid key generation algorithm: "+x);return e};t.rsa.stepKeyPairGenerationState=function(e,m){"algorithm"in e||(e.algorithm="PRIMEINC");var x=new u(null);x.fromInt(30);for(var H=0,L=function(v,I){return v|I},P=+new Date,Q,S=0;e.keys===null&&(m<=0||S<m);){if(e.state===0){Q=e.p===null?e.pBits:e.qBits;var V=Q-1;e.pqState===0?(e.num=new u(Q,e.rng),e.num.testBit(V)||e.num.bitwiseTo(u.ONE.shiftLeft(V),
428L,e.num),e.num.dAddOffset(31-e.num.mod(x).byteValue(),0),H=0,++e.pqState):e.pqState===1?e.num.bitLength()>Q?e.pqState=0:e.num.isProbablePrime(l(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(d[H++%8],0):e.pqState===2?e.pqState=e.num.subtract(u.ONE).gcd(e.e).compareTo(u.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else e.state===1?(e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state):e.state===2?(e.p1=e.p.subtract(u.ONE),
429e.q1=e.q.subtract(u.ONE),e.phi=e.p1.multiply(e.q1),++e.state):e.state===3?e.phi.gcd(e.e).compareTo(u.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0):e.state===4?(e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0)):e.state===5&&(Q=e.e.modInverse(e.phi),e.keys={privateKey:t.rsa.setPrivateKey(e.n,e.e,Q,e.p,e.q,Q.mod(e.p1),Q.mod(e.q1),e.q.modInverse(e.p)),publicKey:t.rsa.setPublicKey(e.n,e.e)});Q=+new Date;S+=Q-P;P=Q}return e.keys!==null};t.rsa.generateKeyPair=function(e,m,
430x,H){arguments.length===1?typeof e==="object"?(x=e,e=void 0):typeof e==="function"&&(H=e,e=void 0):arguments.length===2?typeof e==="number"?typeof m==="function"?(H=m,m=void 0):typeof m!=="number"&&(x=m,m=void 0):(x=e,H=m,m=e=void 0):arguments.length===3&&(typeof m==="number"?typeof x==="function"&&(H=x,x=void 0):(H=x,x=m,m=void 0));x=x||{};e===void 0&&(e=x.bits||2048);m===void 0&&(m=x.e||65537);if(!g.options.usePureJavaScript&&!x.prng&&e>=256&&e<=16384&&(m===65537||m===3))if(H){if(g.util.isNodejs&&
431typeof G.generateKeyPair==="function")return G.generateKeyPair("rsa",{modulusLength:e,publicExponent:m,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(P,Q,S){if(P)return H(P);H(null,{privateKey:t.privateKeyFromPem(S),publicKey:t.publicKeyFromPem(Q)})});if(c("generateKey")&&c("exportKey"))return B.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:b(m),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(P){return B.globalScope.crypto.subtle.exportKey("pkcs8",
432P.privateKey)}).then(void 0,function(P){H(P)}).then(function(P){P&&(P=t.privateKeyFromAsn1(h.fromDer(g.util.createBuffer(P))),H(null,{privateKey:P,publicKey:t.setRsaPublicKey(P.n,P.e)}))});if(a("generateKey")&&a("exportKey")){var L=B.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:b(m),hash:{name:"SHA-256"}},!0,["sign","verify"]);L.oncomplete=function(P){P=B.globalScope.msCrypto.subtle.exportKey("pkcs8",P.target.result.privateKey);P.oncomplete=function(Q){Q=
433t.privateKeyFromAsn1(h.fromDer(g.util.createBuffer(Q.target.result)));H(null,{privateKey:Q,publicKey:t.setRsaPublicKey(Q.n,Q.e)})};P.onerror=function(Q){H(Q)}};L.onerror=function(P){H(P)};return}}else if(g.util.isNodejs&&typeof G.generateKeyPairSync==="function")return L=G.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:m,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}}
433),{privateKey:t.privateKeyFromPem(L.privateKey),publicKey:t.publicKeyFromPem(L.publicKey)};
434L=t.rsa.createKeyPairGenerationState(e,m,x);if(!H)return t.rsa.stepKeyPairGenerationState(L,0),L.keys;O(L,x,H)};t.setRsaPublicKey=t.rsa.setPublicKey=function(e,m){var x={n:e,e:m,encrypt:function(H,L,P){typeof L==="string"?L=L.toUpperCase():L===void 0&&(L="RSAES-PKCS1-V1_5");if(L==="RSAES-PKCS1-V1_5")L={encode:function(Q,S,V){return p(Q,S,2).getBytes()}};else if(L==="RSA-OAEP"||L==="RSAES-OAEP")L={encode:function(Q,S){return g.pkcs1.encode_rsa_oaep(S,Q,P)}};else if(["RAW","NONE","NULL",null].indexOf(L)!==
435-1)L={encode:function(Q){return Q}};else if(typeof L==="string")throw Error('Unsupported encryption scheme: "'+L+'".');H=L.encode(H,x,!0);return t.rsa.encrypt(H,x,!0)},verify:function(H,L,P,Q){typeof P==="string"?P=P.toUpperCase():P===void 0&&(P="RSASSA-PKCS1-V1_5");Q===void 0&&(Q={_parseAllDigestBytes:!0,_skipPaddingChecks:!1});"_parseAllDigestBytes"in Q||(Q._parseAllDigestBytes=!0);"_skipPaddingChecks"in Q||(Q._skipPaddingChecks=!1);if(P==="RSASSA-PKCS1-V1_5")P={verify:function(S,V){V=E(V,x,!0,
436void 0,Q);var v=h.fromDer(V,{parseAllBytes:Q._parseAllDigestBytes});V={};var I=[];if(!h.validate(v,k,V,I)||v.value.length!==2)throw S=Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value."),S.errors=I,S;I=h.derToOid(V.algorithmIdentifier);if(I!==g.oids.md2&&I!==g.oids.md5&&I!==g.oids.sha1&&I!==g.oids.sha224&&I!==g.oids.sha256&&I!==g.oids.sha384&&I!==g.oids.sha512&&I!==g.oids["sha512-224"]&&I!==g.oids["sha512-256"])throw S=Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier."),
437S.oid=I,S;if(!(I!==g.oids.md2&&I!==g.oids.md5||"parameters"in V))throw Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return S===V.digest}};else if(P==="NONE"||P==="NULL"||P===null)P={verify:function(S,V){V=E(V,x,!0,void 0,Q);return S===V}};L=t.rsa.decrypt(L,x,!0,!1);return P.verify(H,L,x.n.bitLength())}};return x};t.setRsaPrivateKey=t.rsa.setPrivateKey=function(e,m,x,H,L,P,Q,S){var V={n:e,e:m,d:x,p:H,q:L,dP:P,dQ:Q,
438qInv:S,decrypt:function(v,I,F){typeof I==="string"?I=I.toUpperCase():I===void 0&&(I="RSAES-PKCS1-V1_5");v=t.rsa.decrypt(v,V,!1,!1);if(I==="RSAES-PKCS1-V1_5")I={decode:E};else if(I==="RSA-OAEP"||I==="RSAES-OAEP")I={decode:function(M,N){return g.pkcs1.decode_rsa_oaep(N,M,F)}};else if(["RAW","NONE","NULL",null].indexOf(I)!==-1)I={decode:function(M){return M}};else throw Error('Unsupported encryption scheme: "'+I+'".');return I.decode(v,V,!1)},sign:function(v,I){var F=!1;typeof I==="string"&&(I=I.toUpperCase());
439if(I===void 0||I==="RSASSA-PKCS1-V1_5")I={encode:w},F=1;else if(I==="NONE"||I==="NULL"||I===null)I={encode:function(){return v}},F=1;I=I.encode(v,V.n.bitLength());return t.rsa.encrypt(I,V,F)}};return V};t.wrapRsaPrivateKey=function(e){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(0).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.oids.rsaEncryption).getBytes()),h.create(h.Class.UNIVERSAL,
440h.Type.NULL,!1,"")]),h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,h.toDer(e).getBytes())])};t.privateKeyFromAsn1=function(e){var m={},x=[];h.validate(e,q,m,x)&&(e=h.fromDer(g.util.createBuffer(m.privateKey)));m={};x=[];if(!h.validate(e,A,m,x))throw m=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey."),m.errors=x,m;x=g.util.createBuffer(m.privateKeyModulus).toHex();e=g.util.createBuffer(m.privateKeyPublicExponent).toHex();var H=g.util.createBuffer(m.privateKeyPrivateExponent).toHex();
441var L=g.util.createBuffer(m.privateKeyPrime1).toHex();var P=g.util.createBuffer(m.privateKeyPrime2).toHex();var Q=g.util.createBuffer(m.privateKeyExponent1).toHex();var S=g.util.createBuffer(m.privateKeyExponent2).toHex();m=g.util.createBuffer(m.privateKeyCoefficient).toHex();return t.setRsaPrivateKey(new u(x,16),new u(e,16),new u(H,16),new u(L,16),new u(P,16),new u(Q,16),new u(S,16),new u(m,16))};t.privateKeyToAsn1=t.privateKeyToRSAPrivateKey=function(e){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,
442!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(0).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,y(e.n)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,y(e.e)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,y(e.d)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,y(e.p)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,y(e.q)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,y(e.dP)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,y(e.dQ)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,y(e.qInv))])};
443t.publicKeyFromAsn1=function(e){var m={},x=[];if(h.validate(e,J,m,x)){x=h.derToOid(m.publicKeyOid);if(x!==t.oids.rsaEncryption)throw m=Error("Cannot read public key. Unknown OID."),m.oid=x,m;e=m.rsaPublicKey}x=[];if(!h.validate(e,D,m,x))throw m=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey."),m.errors=x,m;x=g.util.createBuffer(m.publicKeyModulus).toHex();m=g.util.createBuffer(m.publicKeyExponent).toHex();return t.setRsaPublicKey(new u(x,16),new u(m,16))};t.publicKeyToAsn1=
444t.publicKeyToSubjectPublicKeyInfo=function(e){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.oids.rsaEncryption).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,[t.publicKeyToRSAPublicKey(e)])])};t.publicKeyToRSAPublicKey=function(e){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,y(e.n)),
445h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,y(e.e))])}},
445"./lib/sha1.js":function(K,r,C){function p(l,c,a){for(var b,g,u,G,h,B,t,d,q=a.length();q>=64;){g=l.h0;u=l.h1;G=l.h2;h=l.h3;B=l.h4;for(d=0;d<16;++d)b=a.getInt32(),c[d]=b,t=h^u&(G^h),b=(g<<5|g>>>27)+t+B+1518500249+b,B=h,h=G,G=(u<<30|u>>>2)>>>0,u=g,g=b;for(;d<20;++d)b=c[d-3]^c[d-8]^c[d-14]^c[d-16],b=b<<1|b>>>31,c[d]=b,t=h^u&(G^h),b=(g<<5|g>>>27)+t+B+1518500249+b,B=h,h=G,G=(u<<30|u>>>2)>>>0,u=g,g=b;for(;d<32;++d)b=c[d-3]^c[d-8]^c[d-14]^c[d-16],
446b=b<<1|b>>>31,c[d]=b,t=u^G^h,b=(g<<5|g>>>27)+t+B+1859775393+b,B=h,h=G,G=(u<<30|u>>>2)>>>0,u=g,g=b;for(;d<40;++d)b=c[d-6]^c[d-16]^c[d-28]^c[d-32],b=b<<2|b>>>30,c[d]=b,t=u^G^h,b=(g<<5|g>>>27)+t+B+1859775393+b,B=h,h=G,G=(u<<30|u>>>2)>>>0,u=g,g=b;for(;d<60;++d)b=c[d-6]^c[d-16]^c[d-28]^c[d-32],b=b<<2|b>>>30,c[d]=b,t=u&G|h&(u^G),b=(g<<5|g>>>27)+t+B+2400959708+b,B=h,h=G,G=(u<<30|u>>>2)>>>0,u=g,g=b;for(;d<80;++d)b=c[d-6]^c[d-16]^c[d-28]^c[d-32],b=b<<2|b>>>30,c[d]=b,t=u^G^h,b=(g<<5|g>>>27)+t+B+3395469782+
447b,B=h,h=G,G=(u<<30|u>>>2)>>>0,u=g,g=b;l.h0=l.h0+g|0;l.h1=l.h1+u|0;l.h2=l.h2+G|0;l.h3=l.h3+h|0;l.h4=l.h4+B|0;q-=64}}var E=C("./lib/forge.js");C("./lib/md.js");C("./lib/util.js");K=K.exports=E.sha1=E.sha1||{};E.md.sha1=E.md.algorithms.sha1=K;K.create=function(){y||(O=String.fromCharCode(128),O+=E.util.fillString(String.fromCharCode(0),64),y=!0);var l=null,c=E.util.createBuffer(),a=Array(80),b={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,
448start:function(){b.messageLength=0;b.fullMessageLength=b.messageLength64=[];for(var g=b.messageLengthSize/4,u=0;u<g;++u)b.fullMessageLength.push(0);c=E.util.createBuffer();l={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520};return b}};b.start();b.update=function(g,u){u==="utf8"&&(g=E.util.encodeUtf8(g));u=g.length;b.messageLength+=u;u=[u/4294967296>>>0,u>>>0];for(var G=b.fullMessageLength.length-1;G>=0;--G)b.fullMessageLength[G]+=u[1],u[1]=u[0]+(b.fullMessageLength[G]/4294967296>>>
4490),b.fullMessageLength[G]>>>=0,u[0]=u[1]/4294967296>>>0;c.putBytes(g);p(l,a,c);(c.read>2048||c.length()===0)&&c.compact();return b};b.digest=function(){var g=E.util.createBuffer();g.putBytes(c.bytes());g.putBytes(O.substr(0,b.blockLength-(b.fullMessageLength[b.fullMessageLength.length-1]+b.messageLengthSize&b.blockLength-1)));for(var u,G,h=b.fullMessageLength[0]*8,B=0;B<b.fullMessageLength.length-1;++B)u=b.fullMessageLength[B+1]*8,G=u/4294967296>>>0,h+=G,g.putInt32(h>>>0),h=u>>>0;g.putInt32(h);u=
450{h0:l.h0,h1:l.h1,h2:l.h2,h3:l.h3,h4:l.h4};p(u,a,g);g=E.util.createBuffer();g.putInt32(u.h0);g.putInt32(u.h1);g.putInt32(u.h2);g.putInt32(u.h3);g.putInt32(u.h4);return g};return b};var O=null,y=!1},
450"./lib/sha256.js":function(K,r,C){function p(c,a,b){for(var g,u,G,h,B,t,d,q,A,D,J,k,w,f=b.length();f>=64;){for(B=0;B<16;++B)a[B]=b.getInt32();for(;B<64;++B)g=a[B-2],g=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,u=a[B-15],u=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,a[B]=g+a[B-7]+u+a[B-16]|0;t=c.h0;d=c.h1;q=c.h2;A=c.h3;
451D=c.h4;J=c.h5;k=c.h6;w=c.h7;for(B=0;B<64;++B)g=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7),G=k^D&(J^k),u=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),h=t&d|q&(t^d),g=w+g+G+l[B]+a[B],u+=h,w=k,k=J,J=D,D=A+g>>>0,A=q,q=d,d=t,t=g+u>>>0;c.h0=c.h0+t|0;c.h1=c.h1+d|0;c.h2=c.h2+q|0;c.h3=c.h3+A|0;c.h4=c.h4+D|0;c.h5=c.h5+J|0;c.h6=c.h6+k|0;c.h7=c.h7+w|0;f-=64}}var E=C("./lib/forge.js");C("./lib/md.js");C("./lib/util.js");K=K.exports=E.sha256=E.sha256||{};E.md.sha256=E.md.algorithms.sha256=K;K.create=function(){y||
452(O=String.fromCharCode(128),O+=E.util.fillString(String.fromCharCode(0),64),l=[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,
4532730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],y=!0);var c=null,a=E.util.createBuffer(),b=Array(64),g={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){g.messageLength=0;g.fullMessageLength=g.messageLength64=[];for(var u=
454g.messageLengthSize/4,G=0;G<u;++G)g.fullMessageLength.push(0);a=E.util.createBuffer();c={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225};return g}};g.start();g.update=function(u,G){G==="utf8"&&(u=E.util.encodeUtf8(u));G=u.length;g.messageLength+=G;G=[G/4294967296>>>0,G>>>0];for(var h=g.fullMessageLength.length-1;h>=0;--h)g.fullMessageLength[h]+=G[1],G[1]=G[0]+(g.fullMessageLength[h]/4294967296>>>0),g.fullMessageLength[h]>>>=0,G[0]=G[1]/
4554294967296>>>0;a.putBytes(u);p(c,b,a);(a.read>2048||a.length()===0)&&a.compact();return g};g.digest=function(){var u=E.util.createBuffer();u.putBytes(a.bytes());u.putBytes(O.substr(0,g.blockLength-(g.fullMessageLength[g.fullMessageLength.length-1]+g.messageLengthSize&g.blockLength-1)));for(var G,h,B=g.fullMessageLength[0]*8,t=0;t<g.fullMessageLength.length-1;++t)G=g.fullMessageLength[t+1]*8,h=G/4294967296>>>0,B+=h,u.putInt32(B>>>0),B=G>>>0;u.putInt32(B);G={h0:c.h0,h1:c.h1,h2:c.h2,h3:c.h3,h4:c.h4,
456h5:c.h5,h6:c.h6,h7:c.h7};p(G,b,u);u=E.util.createBuffer();u.putInt32(G.h0);u.putInt32(G.h1);u.putInt32(G.h2);u.putInt32(G.h3);u.putInt32(G.h4);u.putInt32(G.h5);u.putInt32(G.h6);u.putInt32(G.h7);return u};return g};var O=null,y=!1,l=null},
456"./lib/sha512.js":function(K,r,C){function p(b,g,u){for(var G,h,B,t,d,q,A,D,J,k,w,f,e,m,x,H,L,P,Q,S,V,v,I,F,M,N=u.length();N>=128;){for(M=0;M<16;++M)g[M][0]=u.getInt32()>>>0,g[M][1]=u.getInt32()>>>0;for(;M<80;++M)d=g[M-2],J=d[0],d=d[1],G=((J>>>19|d<<13)^(d>>>29|J<<
4573)^J>>>6)>>>0,h=((J<<13|d>>>19)^(d<<3|J>>>29)^(J<<26|d>>>6))>>>0,d=g[M-15],J=d[0],d=d[1],B=((J>>>1|d<<31)^(J>>>8|d<<24)^J>>>7)>>>0,t=((J<<31|d>>>1)^(J<<24|d>>>8)^(J<<25|d>>>7))>>>0,J=g[M-7],k=g[M-16],d=h+J[1]+t+k[1],g[M][0]=G+J[0]+B+k[0]+(d/4294967296>>>0)>>>0,g[M][1]=d>>>0;J=b[0][0];k=b[0][1];w=b[1][0];f=b[1][1];e=b[2][0];m=b[2][1];x=b[3][0];H=b[3][1];L=b[4][0];P=b[4][1];Q=b[5][0];S=b[5][1];V=b[6][0];v=b[6][1];I=b[7][0];F=b[7][1];for(M=0;M<80;++M)G=((L>>>14|P<<18)^(L>>>18|P<<14)^(P>>>9|L<<23))>>>
4580,d=((L<<18|P>>>14)^(L<<14|P>>>18)^(P<<23|L>>>9))>>>0,h=(V^L&(Q^V))>>>0,q=(v^P&(S^v))>>>0,B=((J>>>28|k<<4)^(k>>>2|J<<30)^(k>>>7|J<<25))>>>0,t=((J<<4|k>>>28)^(k<<30|J>>>2)^(k<<25|J>>>7))>>>0,A=(J&w|e&(J^w))>>>0,D=(k&f|m&(k^f))>>>0,d=F+d+q+c[M][1]+g[M][1],G=I+G+h+c[M][0]+g[M][0]+(d/4294967296>>>0)>>>0,h=d>>>0,d=t+D,B=B+A+(d/4294967296>>>0)>>>0,t=d>>>0,I=V,F=v,V=Q,v=S,Q=L,S=P,d=H+h,L=x+G+(d/4294967296>>>0)>>>0,P=d>>>0,x=e,H=m,e=w,m=f,w=J,f=k,d=h+t,J=G+B+(d/4294967296>>>0)>>>0,k=d>>>0;d=b[0][1]+k;b[0][0]=
459b[0][0]+J+(d/4294967296>>>0)>>>0;b[0][1]=d>>>0;d=b[1][1]+f;b[1][0]=b[1][0]+w+(d/4294967296>>>0)>>>0;b[1][1]=d>>>0;d=b[2][1]+m;b[2][0]=b[2][0]+e+(d/4294967296>>>0)>>>0;b[2][1]=d>>>0;d=b[3][1]+H;b[3][0]=b[3][0]+x+(d/4294967296>>>0)>>>0;b[3][1]=d>>>0;d=b[4][1]+P;b[4][0]=b[4][0]+L+(d/4294967296>>>0)>>>0;b[4][1]=d>>>0;d=b[5][1]+S;b[5][0]=b[5][0]+Q+(d/4294967296>>>0)>>>0;b[5][1]=d>>>0;d=b[6][1]+v;b[6][0]=b[6][0]+V+(d/4294967296>>>0)>>>0;b[6][1]=d>>>0;d=b[7][1]+F;b[7][0]=b[7][0]+I+(d/4294967296>>>0)>>>0;
460b[7][1]=d>>>0;N-=128}}var E=C("./lib/forge.js");C("./lib/md.js");C("./lib/util.js");var O=K.exports=E.sha512=E.sha512||{};E.md.sha512=E.md.algorithms.sha512=O;K=E.sha384=E.sha512.sha384=E.sha512.sha384||{};K.create=function(){return O.create("SHA-384")};E.md.sha384=E.md.algorithms.sha384=K;E.sha512.sha256=E.sha512.sha256||{create:function(){return O.create("SHA-512/256")}};E.md["sha512/256"]=E.md.algorithms["sha512/256"]=E.sha512.sha256;E.sha512.sha224=E.sha512.sha224||{create:function(){return O.create("SHA-512/224")}};
461E.md["sha512/224"]=E.md.algorithms["sha512/224"]=E.sha512.sha224;O.create=function(b){l||(y=String.fromCharCode(128),y+=E.util.fillString(String.fromCharCode(0),128),c=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,
462633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],
463[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,
4641125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],
465[1816402316,1246189591]],a={"SHA-512":[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],"SHA-384":[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],"SHA-512/256":[[573645204,4230739756],[2673172387,3360449730],[596883563,
4661867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],"SHA-512/224":[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]]},l=!0);typeof b==="undefined"&&(b="SHA-512");if(!(b in a))throw Error("Invalid SHA-512 algorithm: "+b);for(var g=a[b],u=null,G=E.util.createBuffer(),h=Array(80),B=0;B<80;++B)h[B]=
467Array(2);B=64;switch(b){case "SHA-384":B=48;break;case "SHA-512/256":B=32;break;case "SHA-512/224":B=28}var t={algorithm:b.replace("-","").toLowerCase(),blockLength:128,digestLength:B,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){t.messageLength=0;t.fullMessageLength=t.messageLength128=[];for(var d=t.messageLengthSize/4,q=0;q<d;++q)t.fullMessageLength.push(0);G=E.util.createBuffer();u=Array(g.length);for(q=0;q<g.length;++q)u[q]=g[q].slice(0);return t}};t.start();t.update=
468function(d,q){q==="utf8"&&(d=E.util.encodeUtf8(d));q=d.length;t.messageLength+=q;q=[q/4294967296>>>0,q>>>0];for(var A=t.fullMessageLength.length-1;A>=0;--A)t.fullMessageLength[A]+=q[1],q[1]=q[0]+(t.fullMessageLength[A]/4294967296>>>0),t.fullMessageLength[A]>>>=0,q[0]=q[1]/4294967296>>>0;G.putBytes(d);p(u,h,G);(G.read>2048||G.length()===0)&&G.compact();return t};t.digest=function(){var d=E.util.createBuffer();d.putBytes(G.bytes());d.putBytes(y.substr(0,t.blockLength-(t.fullMessageLength[t.fullMessageLength.length-
4691]+t.messageLengthSize&t.blockLength-1)));for(var q,A,D=t.fullMessageLength[0]*8,J=0;J<t.fullMessageLength.length-1;++J)q=t.fullMessageLength[J+1]*8,A=q/4294967296>>>0,D+=A,d.putInt32(D>>>0),D=q>>>0;d.putInt32(D);q=Array(u.length);for(J=0;J<u.length;++J)q[J]=u[J].slice(0);p(q,h,d);d=E.util.createBuffer();A=b==="SHA-512"?q.length:b==="SHA-384"?q.length-2:q.length-4;for(J=0;J<A;++J)d.putInt32(q[J][0]),J===A-1&&b==="SHA-512/224"||d.putInt32(q[J][1]);return d};return t};var y=null,l=!1,c=null,a=null},
470"./lib/ssh.js":function(K,r,C){function p(l,c){c=c.toString(16);c[0]>="8"&&(c="00"+c);c=y.util.hexToBytes(c);l.putInt32(c.length);l.putBytes(c)}function E(l,c){l.putInt32(c.length);l.putString(c)}function O(){for(var l=y.md.sha1.create(),c=arguments.length,a=0;a<c;++a)l.update(arguments[a]);return l.digest()}var y=C("./lib/forge.js");C("./lib/aes.js");C("./lib/hmac.js");C("./lib/md5.js");C("./lib/sha1.js");C("./lib/util.js");K=K.exports=y.ssh=y.ssh||{};K.privateKeyToPutty=function(l,c,a){a=a||"";
471c=c||"";var b=c===""?"none":"aes256-cbc";var g="PuTTY-User-Key-File-2: ssh-rsa\r\nEncryption: "+(b+"\r\nComment: ")+(a+"\r\n");var u=y.util.createBuffer();E(u,"ssh-rsa");p(u,l.e);p(u,l.n);var G=y.util.encode64(u.bytes(),64),h=Math.floor(G.length/66)+1;g+="Public-Lines: "+h+"\r\n";g+=G;G=y.util.createBuffer();p(G,l.d);p(G,l.p);p(G,l.q);p(G,l.qInv);c?(h=G.length()+16-1,h-=h%16,l=O(G.bytes()),l.truncate(l.length()-h+G.length()),G.putBuffer(l),h=y.util.createBuffer(),h.putBuffer(O("\x00\x00\x00\x00",
472c)),h.putBuffer(O("\x00\x00\x00\u0001",c)),h=y.aes.createEncryptionCipher(h.truncate(8),"CBC"),h.start(y.util.createBuffer().fillWithByte(0,16)),h.update(G.copy()),h.finish(),h=h.output,h.truncate(16),l=y.util.encode64(h.bytes(),64)):l=y.util.encode64(G.bytes(),64);h=Math.floor(l.length/66)+1;g+="\r\nPrivate-Lines: "+h+"\r\n";g+=l;c=O("putty-private-key-file-mac-key",c);h=y.util.createBuffer();E(h,"ssh-rsa");E(h,b);E(h,a);h.putInt32(u.length());h.putBuffer(u);h.putInt32(G.length());h.putBuffer(G);
473a=y.hmac.create();a.start("sha1",c);a.update(h.bytes());return g+="\r\nPrivate-MAC: "+a.digest().toHex()+"\r\n"};K.publicKeyToOpenSSH=function(l,c){c=c||"";var a=y.util.createBuffer();E(a,"ssh-rsa");p(a,l.e);p(a,l.n);return"ssh-rsa "+y.util.encode64(a.bytes())+" "+c};K.privateKeyToOpenSSH=function(l,c){return c?y.pki.encryptRsaPrivateKey(l,c,{legacy:!0,algorithm:"aes128"}):y.pki.privateKeyToPem(l)};K.getPublicKeyFingerprint=function(l,c){c=c||{};var a=c.md||y.md.md5.create(),b=y.util.createBuffer();
474E(b,"ssh-rsa");p(b,l.e);p(b,l.n);a.start();a.update(b.getBytes());l=a.digest();if(c.encoding==="hex")return l=l.toHex(),c.delimiter?l.match(/.{2}/g).join(c.delimiter):l;if(c.encoding==="binary")return l.getBytes();if(c.encoding)throw Error('Unknown encoding "'+c.encoding+'".');return l}},
474"./lib/tls.js":function(K,r,C){var p=C("./lib/forge.js");C("./lib/asn1.js");C("./lib/hmac.js");C("./lib/md5.js");C("./lib/pem.js");C("./lib/pki.js");C("./lib/random.js");C("./lib/sha1.js");C("./lib/util.js");var E=
475function(v,I,F,M){var N=p.util.createBuffer(),z=v.length>>1,n=z+(v.length&1),R=v.substr(0,n);n=v.substr(z,n);v=p.util.createBuffer();z=p.hmac.create();F=I+F;var U=Math.ceil(M/16);I=Math.ceil(M/20);z.start("MD5",R);R=p.util.createBuffer();v.putBytes(F);for(var T=0;T<U;++T)z.start(null,null),z.update(v.getBytes()),v.putBuffer(z.digest()),z.start(null,null),z.update(v.bytes()+F),R.putBuffer(z.digest());z.start("SHA1",n);n=p.util.createBuffer();v.clear();v.putBytes(F);for(T=0;T<I;++T)z.start(null,null),
476z.update(v.getBytes()),v.putBuffer(z.digest()),z.start(null,null),z.update(v.bytes()+F),n.putBuffer(z.digest());N.putBytes(p.util.xorBytes(R.getBytes(),n.getBytes(),M));return N},O=function(v,I,F){F=!1;try{var M=v.deflate(I.fragment.getBytes());I.fragment=p.util.createBuffer(M);I.length=M.length;F=!0}catch(N){}return F},y=function(v,I,F){F=!1;try{var M=v.inflate(I.fragment.getBytes());I.fragment=p.util.createBuffer(M);I.length=M.length;F=!0}catch(N){}return F},l=function(v,I){var F=0;switch(I){case 1:F=
477v.getByte();break;case 2:F=v.getInt16();break;case 3:F=v.getInt24();break;case 4:F=v.getInt32()}return p.util.createBuffer(v.getBytes(F))},c=function(v,I,F){v.putInt(F.length(),I<<3);v.putBuffer(F)},a={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};a.SupportedVersions=[a.Versions.TLS_1_1,a.Versions.TLS_1_0];a.Version=a.SupportedVersions[0];a.MaxFragment=15360;a.ConnectionEnd={server:0,client:1};a.PRFAlgorithm={tls_prf_sha256:0};a.BulkCipherAlgorithm={none:null,
478rc4:0,des3:1,aes:2};a.CipherType={stream:0,block:1,aead:2};a.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};a.CompressionMethod={none:0,deflate:1};a.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};a.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};a.Alert={};a.Alert.Level=
479{warning:1,fatal:2};a.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_de
479nied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};
480a.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};a.CipherSuites={};a.getCipherSuite=function(v){var I=null,F;for(F in a.CipherSuites){var M=a.CipherSuites[F];if(M.id[0]===v.charCodeAt(0)&&M.id[1]===v.charCodeAt(1)){I=M;break}}return I};a.handleUnexpected=function(v,I){(v.open||v.entity!==a.ConnectionEnd.client)&&v.error(v,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unexpected_message}})};
481a.handleHelloRequest=function(v,I,F){!v.handshaking&&v.handshakes>0&&(a.queue(v,a.createAlert(v,{level:a.Alert.Level.warning,description:a.Alert.Description.no_renegotiation})),a.flush(v));v.process()};a.parseHelloMessage=function(v,I,F){var M=null,N=v.entity===a.ConnectionEnd.client;if(F<38)v.error(v,{message:N?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});
482else{I=I.fragment;var z=I.length();M={version:{major:I.getByte(),minor:I.getByte()},random:p.util.createBuffer(I.getBytes(32)),session_id:l(I,1),extensions:[]};N?(M.cipher_suite=I.getBytes(2),M.compression_method=I.getByte()):(M.cipher_suites=l(I,2),M.compression_methods=l(I,1));z=F-(z-I.length());if(z>0){for(F=l(I,2);F.length()>0;)M.extensions.push({type:[F.getByte(),F.getByte()],data:l(F,2)});if(!N)for(F=0;F<M.extensions.length;++F)if(I=M.extensions[F],I.type[0]===0&&I.type[1]===0)for(I=l(I.data,
4832);I.length()>0&&I.getByte()===0;)v.session.extensions.server_name.serverNameList.push(l(I,2).getBytes())}if(v.session.version&&(M.version.major!==v.session.version.major||M.version.minor!==v.session.version.minor))return v.error(v,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}});if(N)v.session.cipherSuite=a.getCipherSuite(M.cipher_suite);else for(F=p.util.createBuffer(M.cipher_suites.bytes());F.length()>
4840&&(v.session.cipherSuite=a.getCipherSuite(F.getBytes(2)),v.session.cipherSuite===null););if(v.session.cipherSuite===null)return v.error(v,{message:"No cipher suites in common.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.handshake_failure},cipherSuite:p.util.bytesToHex(M.cipher_suite)});v.session.compressionMethod=N?M.compression_method:a.CompressionMethod.none}return M};a.createSecurityParameters=function(v,I){var F=v.entity===a.ConnectionEnd.client,M=I.random.bytes();
485I=F?v.session.sp.client_random:M;F=F?M:a.createRandom().getBytes();v.session.sp={entity:v.entity,prf_algorithm:a.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:v.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:I,server_random:F}};a.handleServerHello=function(v,I,F){I=a.parseHelloMessage(v,
486I,F);if(!v.fail){if(I.version.minor<=v.version.minor)v.version.minor=I.version.minor;else return v.error(v,{message:"Incompatible TLS version.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}});v.session.version=v.version;F=I.session_id.bytes();F.length>0&&F===v.session.id?(v.expect=h,v.session.resuming=!0,v.session.sp.server_random=I.random.bytes()):(v.expect=b,v.session.resuming=!1,a.createSecurityParameters(v,I));v.session.id=F;v.process()}};a.handleClientHello=
487function(v,I,F){I=a.parseHelloMessage(v,I,F);if(!v.fail){var M=I.session_id.bytes();F=null;if(v.sessionCache)if(F=v.sessionCache.getSession(M),F===null)M="";else if(F.version.major!==I.version.major||F.version.minor>I.version.minor)F=null,M="";M.length===0&&(M=p.random.getBytes(32));v.session.id=M;v.session.clientHelloVersion=I.version;v.session.sp={};if(F)v.version=v.session.version=F.version,v.session.sp=F.sp;else{for(M=1;M<a.SupportedVersions.length;++M){var N=a.SupportedVersions[M];if(N.minor<=
488I.version.minor)break}v.version={major:N.major,minor:N.minor};v.session.version=v.version}F!==null?(v.expect=J,v.session.resuming=!0,v.session.sp.client_random=I.random.bytes()):(v.expect=v.verifyClient!==!1?q:A,v.session.resuming=!1,a.createSecurityParameters(v,I));v.open=!0;a.queue(v,a.createRecord(v,{type:a.ContentType.handshake,data:a.createServerHello(v)}));v.session.resuming?(a.queue(v,a.createRecord(v,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),v.state.pending=
489a.createConnectionState(v),v.state.current.write=v.state.pending.write,a.queue(v,a.createRecord(v,{type:a.ContentType.handshake,data:a.createFinished(v)}))):(a.queue(v,a.createRecord(v,{type:a.ContentType.handshake,data:a.createCertificate(v)}
489)),v.fail||(a.queue(v,a.createRecord(v,{type:a.ContentType.handshake,data:a.createServerKeyExchange(v)})),v.verifyClient!==!1&&a.queue(v,a.createRecord(v,{type:a.ContentType.handshake,data:a.createCertificateRequest(v)})),a.queue(v,a.createRecord(v,{type:a.ContentType.handshake,
490data:a.createServerHelloDone(v)}))));a.flush(v);v.process()}};a.handleCertificate=function(v,I,F){if(F<3)return v.error(v,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});F=l(I.fragment,3);I=[];try{for(;F.length()>0;){var M=l(F,3);var N=p.asn1.fromDer(M);M=p.pki.certificateFromAsn1(N,!0);I.push(M)}}catch(z){return v.error(v,{message:"Could not parse certificate list.",cause:z,send:!0,alert:{level:a.Alert.Level.fatal,
491description:a.Alert.Description.bad_certificate}})}M=v.entity===a.ConnectionEnd.client;!M&&v.verifyClient!==!0||I.length!==0?I.length===0?v.expect=M?g:A:(M?v.session.serverCertificate=I[0]:v.session.clientCertificate=I[0],a.verifyCertificateChain(v,I)&&(v.expect=M?g:A)):v.error(v,{message:M?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});v.process()};a.handleServerKeyExchange=function(v,
492I,F){if(F>0)return v.error(v,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unsupported_certificate}});v.expect=u;v.process()};a.handleClientKeyExchange=function(v,I,F){if(F<48)return v.error(v,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unsupported_certificate}});I=l(I.fragment,2).getBytes();F=null;if(v.getPrivateKey)try{F=v.getPrivateKey(v,
493v.session.serverCertificate),F=p.pki.privateKeyFromPem(F)}catch(z){v.error(v,{message:"Could not get private key.",cause:z,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}})}if(F===null)return v.error(v,{message:"No private key set.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}});try{var M=v.session.sp;M.pre_master_secret=F.decrypt(I);var N=v.session.clientHelloVersion;if(N.major!==M.pre_master_secret.charCodeAt(0)||
494N.minor!==M.pre_master_secret.charCodeAt(1))throw Error("TLS version rollback attack detected.");}catch(z){M.pre_master_secret=p.random.getBytes(48)}v.expect=J;v.session.clientCertificate!==null&&(v.expect=D);v.process()};a.handleCertificateRequest=function(v,I,F){if(F<3)return v.error(v,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});I=I.fragment;I={certificate_types:l(I,1),certificate_authorities:l(I,
4952)};v.session.certificateRequest=I;v.expect=G;v.process()};a.handleCertificateVerify=function(v,I,F){if(F<2)return v.error(v,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});F=I.fragment;F.read-=4;I=F.bytes();F.read+=4;F=l(F,2).getBytes();var M=p.util.createBuffer();M.putBuffer(v.session.md5.digest());M.putBuffer(v.session.sha1.digest());M=M.getBytes();try{if(!v.session.clientCertificate.publicKey.verify(M,
496F,"NONE"))throw Error("CertificateVerify signature does not match.");v.session.md5.update(I);v.session.sha1.update(I)}catch(N){return v.error(v,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.handshake_failure}})}v.expect=J;v.process()};a.handleServerHelloDone=function(v,I,F){if(F>0)return v.error(v,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.record_overflow}});
497if(v.serverCertificate===null&&(I={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.insufficient_security}}
497,F=v.verify(v,I.alert.description,0,[]),F!==!0)){if(F||F===0)typeof F!=="object"||p.util.isArray(F)?typeof F==="number"&&(I.alert.description=F):(F.message&&(I.message=F.message),F.alert&&(I.alert.description=F.alert));return v.error(v,I)}v.session.certificateRequest!==null&&(I=a.createRecord(v,{type:a.ContentType.handshake,
498data:a.createCertificate(v)}),a.queue(v,I));I=a.createRecord(v,{type:a.ContentType.handshake,data:a.createClientKeyExchange(v)});a.queue(v,I);v.expect=d;I=function(M,N){M.session.certificateRequest!==null&&M.session.clientCertificate!==null&&a.queue(M,a.createRecord(M,{type:a.ContentType.handshake,data:a.createCertificateVerify(M,N)}));a.queue(M,a.createRecord(M,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()}));M.state.pending=a.createConnectionState(M);M.state.current.write=
499M.state.pending.write;a.queue(M,a.createRecord(M,{type:a.ContentType.handshake,data:a.createFinished(M)}));M.expect=h;a.flush(M);M.process()};if(v.session.certificateRequest===null||v.session.clientCertificate===null)return I(v,null);a.getClientSignature(v,I)};a.handleChangeCipherSpec=function(v,I){if(I.fragment.getByte()!==1)return v.error(v,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.illegal_parameter}});I=v.entity===
500a.ConnectionEnd.client;if(v.session.resuming&&I||!v.session.resuming&&!I)v.state.pending=a.createConnectionState(v);v.state.current.read=v.state.pending.read;if(!v.session.resuming&&I||v.session.resuming&&!I)v.state.pending=null;v.expect=I?B:k;v.process()};a.handleFinished=function(v,I,F){F=I.fragment;F.read-=4;var M=F.bytes();F.read+=4;I=I.fragment.getBytes();F=p.util.createBuffer();F.putBuffer(v.session.md5.digest());F.putBuffer(v.session.sha1.digest());var N=v.entity===a.ConnectionEnd.client;F=
501E(v.session.sp.master_secret,N?"server finished":"client finished",F.getBytes(),12);if(F.getBytes()!==I)return v.error(v,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.decrypt_error}});v.session.md5.update(M);v.session.sha1.update(M);if(v.session.resuming&&N||!v.session.resuming&&!N)a.queue(v,a.createRecord(v,{type:a.ContentType.change_cipher_spec,data:a.createChangeCipherSpec()})),v.state.current.write=v.state.pending.write,
502v.state.pending=null,a.queue(v,a.createRecord(v,{type:a.ContentType.handshake,data:a.createFinished(v)}));v.expect=N?t:w;v.handshaking=!1;++v.handshakes;v.peerCertificate=N?v.session.serverCertificate:v.session.clientCertificate;a.flush(v);v.isConnected=!0;v.connected(v);v.process()};a.handleAlert=function(v,I){I=I.fragment;I={level:I.getByte(),description:I.getByte()};switch(I.description){case a.Alert.Description.close_notify:var F="Connection closed.";break;case a.Alert.Description.unexpected_message:F=
503"Unexpected message.";break;case a.Alert.Description.bad_record_mac:F="Bad record MAC.";break;case a.Alert.Description.decryption_failed:F="Decryption failed.";break;case a.Alert.Description.record_overflow:F="Record overflow.";break;case a.Alert.Description.decompression_failure:F="Decompression failed.";break;case a.Alert.Description.handshake_failure:F="Handshake failure.";break;case a.Alert.Description.bad_certificate:F="Bad certificate.";break;case a.Alert.Description.unsupported_certificate:F=
504"Unsupported certificate.";break;case a.Alert.Description.certificate_revoked:F="Certificate revoked.";break;case a.Alert.Description.certificate_expired:F="Certificate expired.";break;case a.Alert.Description.certificate_unknown:F="Certificate unknown.";break;case a.Alert.Description.illegal_parameter:F="Illegal parameter.";break;case a.Alert.Description.unknown_ca:F="Unknown certificate authority.";break;case a.Alert.Description.access_denied:F="Access denied.";break;case a.Alert.Description.decode_error:F=
505"Decode error.";break;case a.Alert.Description.decrypt_error:F="Decrypt error.";break;case a.Alert.Description.export_restriction:F="Export restriction.";break;case a.Alert.Description.protocol_version:F="Unsupported protocol version.";break;case a.Alert.Description.insufficient_security:F="Insufficient security.";break;case a.Alert.Description.internal_error:F="Internal error.";break;case a.Alert.Description.user_canceled:F="User canceled.";break;case a.Alert.Description.no_renegotiation:F="Renegotiation not supported.";
506break;default:F="Unknown error."}if(I.description===a.Alert.Description.close_notify)return v.close();v.error(v,{message:F,send:!1,origin:v.entity===a.ConnectionEnd.client?"server"
506:"client",alert:I});v.process()};a.handleHandshake=function(v,I){var F=I.fragment,M=F.getByte(),N=F.getInt24();if(N>F.length())return v.fragmented=I,I.fragment=p.util.createBuffer(),F.read-=4,v.process();v.fragmented=null;F.read-=4;var z=F.bytes(N+4);F.read+=4;M in P[v.entity][v.expect]?(v.entity!==a.ConnectionEnd.server||
507v.open||v.fail||(v.handshaking=!0,v.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:p.md.md5.create(),sha1:p.md.sha1.create()}),M!==a.HandshakeType.hello_request&&M!==a.HandshakeType.certificate_verify&&M!==a.HandshakeType.finished&&(v.session.md5.update(z),v.session.sha1.update(z)),P[v.entity][v.expect][M](v,I,N)):a.handleUnexpected(v,I)};a.handleApplicationData=function(v,I){v.data.putBuffer(I.fragment);
508v.dataReady(v);v.process()};a.handleHeartbeat=function(v,I){var F=I.fragment;I=F.getByte();var M=F.getInt16();F=F.getBytes(M);if(I===a.HeartbeatMessageType.heartbeat_request){if(v.handshaking||M>F.length)return v.process();a.queue(v,a.createRecord(v,{type:a.ContentType.heartbeat,data:a.createHeartbeat(a.HeartbeatMessageType.heartbeat_response,F)}));a.flush(v)}else if(I===a.HeartbeatMessageType.heartbeat_response){if(F!==v.expectedHeartbeatPayload)return v.process();v.heartbeatReceived&&v.heartbeatReceived(v,
509p.util.createBuffer(F))}v.process()};var b=1,g=2,u=3,G=4,h=5,B=6,t=7,d=8,q=1,A=2,D=3,J=4,k=5,w=6;r=a.handleUnexpected;C=a.handleChangeCipherSpec;var f=a.handleAlert,e=a.handleHandshake,m=a.handleApplicationData,x=a.handleHeartbeat,H=[];H[a.ConnectionEnd.client]=[[r,f,e,r,x],[r,f,e,r,x],[r,f,e,r,x],[r,f,e,r,x],[r,f,e,r,x],[C,f,r,r,x],[r,f,e,r,x],[r,f,e,m,x],[r,f,e,r,x]];H[a.ConnectionEnd.server]=[[r,f,e,r,x],[r,f,e,r,x],[r,f,e,r,x],[r,f,e,r,x],[C,f,r,r,x],[r,f,e,r,x],[r,f,e,m,x],[r,f,e,r,x]];C=a.handleHelloRequest;
510f=a.handleCertificate;e=a.handleServerKeyExchange;m=a.handleCertificateRequest;x=a.handleServerHelloDone;var L=a.handleFinished,P=[];P[a.ConnectionEnd.client]=[[r,r,a.handleServerHello,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[C,r,r,r,r,r,r,r,r,r,r,f,e,m,x,r,r,r,r,r,r],[C,r,r,r,r,r,r,r,r,r,r,r,e,m,x,r,r,r,r,r,r],[C,r,r,r,r,r,r,r,r,r,r,r,r,m,x,r,r,r,r,r,r],[C,r,r,r,r,r,r,r,r,r,r,r,r,r,x,r,r,r,r,r,r],[C,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[C,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,L],[C,r,r,r,r,r,r,
511r,r,r,r,r,r,r,r,r,r,r,r,r,r],[C,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r]];P[a.ConnectionEnd.server]=[[r,a.handleClientHello,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,f,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,a.handleClientKeyExchange,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,a.handleCertificateVerify,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,L],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,
512r,r,r,r,r,r,r,r]];a.generateKeys=function(v,I){var F=I.client_random+I.server_random;v.session.resuming||(I.master_secret=E(I.pre_master_secret,"master secret",F,48).bytes(),I.pre_master_secret=null);F=I.server_random+I.client_random;var M=2*I.mac_key_length+2*I.enc_key_length;(v=v.version.major===a.Versions.TLS_1_0.major&&v.version.minor===a.Versions.TLS_1_0.minor)&&(M+=2*I.fixed_iv_length);F=E(I.master_secret,"key expansion",F,M);M={client_write_MAC_key:F.getBytes(I.mac_key_length),server_write_MAC_key:F.getBytes(I.mac_key_length),
513client_write_key:F.getBytes(I.enc_key_length),server_write_key:F.getBytes(I.enc_key_length)};v&&(M.client_write_IV=F.getBytes(I.fixed_iv_length),M.server_write_IV=F.getBytes(I.fixed_iv_length));return M};a.createConnectionState=function(v){var I=v.entity===a.ConnectionEnd.client,F=function(){var N={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(z){return!0},compressionState:null,compressFunction:function(z){return!0},updateSequenceNumber:function(){N.sequenceNumber[1]===
5144294967295?(N.sequenceNumber[1]=0,++N.sequenceNumber[0]):++N.sequenceNumber[1]}};return N},M={read:F(),write:F()};M.read.update=function(N,z){M.read.cipherFunction(z,M.read)?M.read.compressFunction(N,z,M.read)||N.error(N,{message:"Could not decompress record.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.decompression_failure}}):N.error(N,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_record_mac}});
515return!N.fail};M.write.update=function(N,z){M.write.compressFunction(N,z,M.write)?M.write.cipherFunction(z,M.write)||N.error(N,{message:"Could not encrypt record.",send:!1,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}):N.error(N,{message:"Could not compress record.",send:!1,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}});return!N.fail};if(v.session)switch(F=v.session.sp,v.session.cipherSuite.initSecurityParameters(F),F.keys=a.generateKeys(v,
516F),M.read.macKey=I?F.keys.server_write_MAC_key:F.keys.client_write_MAC_key,M.write.macKey=I?F.keys.client_write_MAC_key:F.keys.server_write_MAC_key,v.session.cipherSuite.initConnectionState(M,v,F),F.compression_algorithm){case a.CompressionMethod.none:break;case a.CompressionMethod.deflate:M.read.compressFunction=y;M.write.compressFunction=O;break;default:throw Error("Unsupported compression algorithm.");}return M};a.createRandom=function(){var v=new Date;v=+v+v.getTimezoneOffset()*6E4;var I=p.util.createBuffer();
517I.putInt32(v);I.putBytes(p.random.getBytes(28));return I};a.createRecord=function(v,I){return I.data?{type:I.type,version:{major:v.version.major,minor:v.version.minor},length:I.data.length(),fragment:I.data}:null};a.createAlert=function(v,I){var F=p.util.createBuffer();F.putByte(I.level);F.putByte(I.description);return a.createRecord(v,{type:a.ContentType.alert,data:F})};a.createClientHello=function(v){v.session.clientHelloVersion={major:v.version.major,minor:v.version.minor};for(var I=p.util.createBuffer(),
518F=0;F<v.cipherSuites.length;++F){var M=v.cipherSuites[F];I.putByte(M.id[0]);I.putByte(M.id[1])}var N=I.length();F=p.util.createBuffer();F.putByte(a.CompressionMethod.none);var z=F.length();M=p.util.createBuffer();if(v.virtualHost){var n=p.util.createBuffer();n.putByte(0);n.putByte(0);var R=p.util.createBuffer();R.putByte(0);c(R,2,p.util.createBuffer(v.virtualHost));var U=p.util.createBuffer();c(U,2,R);c(n,2,U);M.putBuffer(n)}n=M.length();n>0&&(n+=2);R=v.session.id;N=R.length+1+2+4+28+2+N+1+z+n;z=
519p.util.createBuffer();z.putByte(a.HandshakeType.client_hello);z.putInt24(N);z.putByte(v.version.major);z.putByte(v.version.minor);z.putBytes(v.session.sp.client_random);c(z,1,p.util.createBuffer(R));c(z,2,I);c(z,1,F);n>0&&c(z,2,M);return z};a.createServerHello=function(v){var I=v.session.id,F=I.length+1+2+4+28+2+1,M=p.util.createBuffer();M.putByte(a.HandshakeType.server_hello);M.putInt24(F);M.putByte(v.version.major);M.putByte(v.version.minor);M.putBytes(v.session.sp.server_random);c(M,1,p.util.createBuffer(I));
520M.putByte(v.session.cipherSuite.id[0]);M.putByte(v.session.cipherSuite.id[1]);M.putByte(v.session.compressionMethod);return M};a.createCertificate=function(v){var I=v.entity===a.ConnectionEnd.client,F=null;v.getCertificate&&(F=v.getCertificate(v,I?v.session.certificateRequest:v.session.extensions.server_name.serverNameList));var M=p.util.createBuffer();if(F!==null)try{p.util.isArray(F)||(F=[F]);for(var N=null,z=0;z<F.length;++z){var n=p.pem.decode(F[z])[0];if(n.type!=="CERTIFICATE"&&n.type!=="X509 CERTIFICATE"&&
521n.type!=="TRUSTED CERTIFICATE"){var R=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');R.headerType=n.type;throw R;}if(n.procType&&n.procType.type==="ENCRYPTED")throw Error("Could not convert certificate from PEM; PEM is encrypted.");var U=p.util.createBuffer(n.body);N===null&&(N=p.asn1.fromDer(U.bytes(),!1));var T=p.util.createBuffer();c(T,3,U);M.putBuffer(T)}F=p.pki.certificateFromAsn1(N);I?v.session.clientCertificate=
522F:v.session.serverCertificate=F}catch(Y){return v.error(v,{message:"Could not send certificate list.",cause:Y,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.bad_certificate}})}v=3+M.length();I=p.util.createBuffer();I.putByte(a.HandshakeType.certificate);I.putInt24(v);c(I,3,M);return I};a.createClientKeyExchange=function(v){var I=p.util.createBuffer();I.putByte(v.session.clientHelloVersion.major);I.putByte(v.session.clientHelloVersion.minor);I.putBytes(p.random.getBytes(46));
523var F=v.session.sp;F.pre_master_secret=I.getBytes();
523I=v.session.serverCertificate.publicKey.encrypt(F.pre_master_secret);v=I.length+2;F=p.util.createBuffer();F.putByte(a.HandshakeType.client_key_exchange);F.putInt24(v);F.putInt16(I.length);F.putBytes(I);return F};a.createServerKeyExchange=function(v){return p.util.createBuffer()};a.getClientSignature=function(v,I){var F=p.util.createBuffer();F.putBuffer(v.session.md5.digest());F.putBuffer(v.session.sha1.digest());F=F.getBytes();v.getSignature=v.getSignature||
524function(M,N,z){var n=null;if(M.getPrivateKey)try{n=M.getPrivateKey(M,M.session.clientCertificate),n=p.pki.privateKeyFromPem(n)}catch(R){M.error(M,{message:"Could not get private key.",cause:R,send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}})}n===null?M.error(M,{message:"No private key set.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.internal_error}}):N=n.sign(N,null);z(M,N)};v.getSignature(v,F,I)};a.createCertificateVerify=function(v,
525I){v=I.length+2;var F=p.util.createBuffer();F.putByte(a.HandshakeType.certificate_verify);F.putInt24(v);F.putInt16(I.length);F.putBytes(I);return F};a.createCertificateRequest=function(v){var I=p.util.createBuffer();I.putByte(1);var F=p.util.createBuffer();for(N in v.caStore.certs){var M=p.pki.distinguishedNameToAsn1(v.caStore.certs[N].subject);M=p.asn1.toDer(M);F.putInt16(M.length());F.putBuffer(M)}v=1+I.length()+2+F.length();var N=p.util.createBuffer();N.putByte(a.HandshakeType.certificate_request);
526N.putInt24(v);c(N,1,I);c(N,2,F);return N};a.createServerHelloDone=function(v){v=p.util.createBuffer();v.putByte(a.HandshakeType.server_hello_done);v.putInt24(0);return v};a.createChangeCipherSpec=function(){var v=p.util.createBuffer();v.putByte(1);return v};a.createFinished=function(v){var I=p.util.createBuffer();I.putBuffer(v.session.md5.digest());I.putBuffer(v.session.sha1.digest());I=E(v.session.sp.master_secret,v.entity===a.ConnectionEnd.client?"client finished":"server finished",I.getBytes(),
52712);v=p.util.createBuffer();v.putByte(a.HandshakeType.finished);v.putInt24(I.length());v.putBuffer(I);return v};a.createHeartbeat=function(v,I,F){typeof F==="undefined"&&(F=I.length);var M=p.util.createBuffer();M.putByte(v);M.putInt16(F);M.putBytes(I);v=M.length();M.putBytes(p.random.getBytes(Math.max(16,v-F-3)));return M};a.queue=function(v,I){if(I&&(I.fragment.length()!==0||I.type!==a.ContentType.handshake&&I.type!==a.ContentType.alert&&I.type!==a.ContentType.change_cipher_spec)){if(I.type===a.ContentType.handshake){var F=
528I.fragment.bytes();v.session.md5.update(F);v.session.sha1.update(F)}if(I.fragment.length()<=a.MaxFragment)F=[I];else{F=[];for(var M=I.fragment.bytes();M.length>a.MaxFragment;)F.push(a.createRecord(v,{type:I.type,data:p.util.createBuffer(M.slice(0,a.MaxFragment))})),M=M.slice(a.MaxFragment);M.length>0&&F.push(a.createRecord(v,{type:I.type,data:p.util.createBuffer(M)}))}for(I=0;I<F.length&&!v.fail;++I)M=F[I],v.state.current.write.update(v,M)&&v.records.push(M)}};a.flush=function(v){for(var I=0;I<v.records.length;++I){var F=
529v.records[I];v.tlsData.putByte(F.type);v.tlsData.putByte(F.version.major);v.tlsData.putByte(F.version.minor);v.tlsData.putInt16(F.fragment.length());v.tlsData.putBuffer(v.records[I].fragment)}v.records=[];return v.tlsDataReady(v)};var Q=function(v){switch(v){case !0:return!0;case p.pki.certificateError.bad_certificate:return a.Alert.Description.bad_certificate;case p.pki.certificateError.unsupported_certificate:return a.Alert.Description.unsupported_certificate;case p.pki.certificateError.certificate_revoked:return a.Alert.Description.certificate_revoked;
530case p.pki.certificateError.certificate_expired:return a.Alert.Description.certificate_expired;case p.pki.certificateError.certificate_unknown:return a.Alert.Description.certificate_unknown;case p.pki.certificateError.unknown_ca:return a.Alert.Description.unknown_ca;default:return a.Alert.Description.bad_certificate}},S=function(v){switch(v){case !0:return!0;case a.Alert.Description.bad_certificate:return p.pki.certificateError.bad_certificate;case a.Alert.Description.unsupported_certificate:return p.pki.certificateError.unsupported_certificate;
531case a.Alert.Description.certificate_revoked:return p.pki.certificateError.certificate_revoked;case a.Alert.Description.certificate_expired:return p.pki.certificateError.certificate_expired;case a.Alert.Description.certificate_unknown:return p.pki.certificateError.certificate_unknown;case a.Alert.Description.unknown_ca:return p.pki.certificateError.unknown_ca;default:return p.pki.certificateError.bad_certificate}};a.verifyCertificateChain=function(v,I){try{var F={},M;for(M in v.verifyOptions)F[M]=
532v.verifyOptions[M];F.verify=function(N,z,n){Q(N);z=v.verify(v,N,z,n);if(z!==!0){if(typeof z==="object"&&!p.util.isArray(z))throw N=Error("The application rejected the certificate."),N.send=!0,N.alert={level:a.Alert.Level.fatal,description:a.Alert.Description.bad_certificate},z.message&&(N.message=z.message),z.alert&&(N.alert.description=z.alert),N;z!==N&&(z=S(z))}return z};p.pki.verifyCertificateChain(v.caStore,I,F)}catch(N){I=N;
532if(typeof I!=="object"||p.util.isArray(I))I={send:!0,alert:{level:a.Alert.Level.fatal,
533description:Q(N)}};"send"in I||(I.send=!0);"alert"in I||(I.alert={level:a.Alert.Level.fatal,description:Q(I.error)});v.error(v,I)}return!v.fail};a.createSessionCache=function(v,I){var F=null;if(v&&v.getSession&&v.setSession&&v.order)F=v;else{F={};F.cache=v||{};F.capacity=Math.max(I||100,1);F.order=[];for(var M in v)F.order.length<=I?F.order.push(M):delete v[M];F.getSession=function(N){var z=null,n=null;N?n=p.util.bytesToHex(N):F.order.length>0&&(n=F.order[0]);if(n!==null&&n in F.cache){z=F.cache[n];
534delete F.cache[n];for(var R in F.order)if(F.order[R]===n){F.order.splice(R,1);break}}return z};F.setSession=function(N,z){if(F.order.length===F.capacity){var n=F.order.shift();delete F.cache[n]}n=p.util.bytesToHex(N);F.order.push(n);F.cache[n]=z}}return F};a.createConnection=function(v){var I=null;I=v.caStore?p.util.isArray(v.caStore)?p.pki.createCaStore(v.caStore):v.caStore:p.pki.createCaStore();var F=v.cipherSuites||null;if(F===null){F=[];for(var M in a.CipherSuites)F.push(a.CipherSuites[M])}M=
535v.server?a.ConnectionEnd.server:a.ConnectionEnd.client;var N=v.sessionCache?a.createSessionCache(v.sessionCache):null,z={version:{major:a.Version.major,minor:a.Version.minor},entity:M,sessionId:v.sessionId,caStore:I,sessionCache:N,cipherSuites:F,connected:v.connected,virtualHost:v.virtualHost||null,verifyClient:v.verifyClient||!1,verify:v.verify||function(n,R,U,T){return R},verifyOptions:v.verifyOptions||{},getCertificate:v.getCertificate||null,getPrivateKey:v.getPrivateKey||null,getSignature:v.getSignature||
536null,input:p.util.createBuffer(),tlsData:p.util.createBuffer(),data:p.util.createBuffer(),tlsDataReady:v.tlsDataReady,dataReady:v.dataReady,heartbeatReceived:v.heartbeatReceived,closed:v.closed,error:function(n,R){R.origin=R.origin||(n.entity===a.ConnectionEnd.client?"client":"server");R.send&&(a.queue(n,a.createAlert(n,R.alert)),a.flush(n));var U=R.fatal!==!1;U&&(n.fail=!0);v.error(n,R);U&&n.close(!1)},deflate:v.deflate||null,inflate:v.inflate||null,reset:function(n){z.version={major:a.Version.major,
537minor:a.Version.minor};z.record=null;z.session=null;z.peerCertificate=null;z.state={pending:null,current:null};z.expect=0;z.fragmented=null;z.records=[];z.open=!1;z.handshakes=0;z.handshaking=!1;z.isConnected=!1;z.fail=!(n||typeof n==="undefined");z.input.clear();z.tlsData.clear();z.data.clear();z.state.current=a.createConnectionState(z)}};z.reset();z.handshake=function(n){if(z.entity!==a.ConnectionEnd.client)z.error(z,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(z.handshaking)z.error(z,
538{message:"Handshake already in progress.",fatal:!1});else{z.fail&&!z.open&&z.handshakes===0&&(z.fail=!1);z.handshaking=!0;n=n||"";var R=null;n.length>0&&(z.sessionCache&&(R=z.sessionCache.getSession(n)),R===null&&(n=""));n.length===0&&z.sessionCache&&(R=z.sessionCache.getSession(),R!==null&&(n=R.id));z.session={id:n,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:p.md.md5.create(),sha1:p.md.sha1.create()};R&&(z.version=
539R.version,z.session.sp=R.sp);z.session.sp.client_random=a.createRandom().getBytes();z.open=!0;a.queue(z,a.createRecord(z,{type:a.ContentType.handshake,data:a.createClientHello(z)}));a.flush(z)}};z.process=function(n){var R=0;n&&z.input.putBytes(n);if(!z.fail){z.record!==null&&z.record.ready&&z.record.fragment.isEmpty()&&(z.record=null);if(z.record===null){R=0;n=z.input;var U=n.length();U<5?R=5-U:(z.record={type:n.getByte(),version:{major:n.getByte(),minor:n.getByte()},length:n.getInt16(),fragment:p.util.createBuffer(),
540ready:!1},(n=z.record.version.major===z.version.major)&&z.session&&z.session.version&&(n=z.record.version.minor===z.version.minor),n||z.error(z,{message:"Incompatible TLS version.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.protocol_version}}
540))}z.fail||z.record===null||z.record.ready||(R=0,n=z.input,U=n.length(),U<z.record.length?R=z.record.length-U:(z.record.fragment.putBytes(n.getBytes(z.record.length)),n.compact(),z.state.current.read.update(z,z.record)&&(z.fragmented!==
541null&&(z.fragmented.type===z.record.type?(z.fragmented.fragment.putBuffer(z.record.fragment),z.record=z.fragmented):z.error(z,{message:"Invalid fragmented record.",send:!0,alert:{level:a.Alert.Level.fatal,description:a.Alert.Description.unexpected_message}})),z.record.ready=!0)));if(!z.fail&&z.record!==null&&z.record.ready){n=z.record;U=n.type-a.ContentType.change_cipher_spec;var T=H[z.entity][z.expect];if(U in T)T[U](z,n);else a.handleUnexpected(z,n)}}return R};z.prepare=function(n){a.queue(z,a.createRecord(z,
542{type:a.ContentType.application_data,data:p.util.createBuffer(n)}));return a.flush(z)};z.prepareHeartbeatRequest=function(n,R){n instanceof p.util.ByteBuffer&&(n=n.bytes());typeof R==="undefined"&&(R=n.length);z.expectedHeartbeatPayload=n;a.queue(z,a.createRecord(z,{type:a.ContentType.heartbeat,data:a.createHeartbeat(a.HeartbeatMessageType.heartbeat_request,n,R)}));return a.flush(z)};z.close=function(n){if(!z.fail&&z.sessionCache&&z.session){var R={id:z.session.id,version:z.session.version,sp:z.session.sp};
543R.sp.keys=null;z.sessionCache.setSession(R.id,R)}if(z.open){z.open=!1;z.input.clear();if(z.isConnected||z.handshaking)z.isConnected=z.handshaking=!1,a.queue(z,a.createAlert(z,{level:a.Alert.Level.warning,description:a.Alert.Description.close_notify})),a.flush(z);z.closed(z)}z.reset(n)};return z};K.exports=p.tls=p.tls||{};for(var V in a)typeof a[V]!=="function"&&(p.tls[V]=a[V]);p.tls.prf_tls1=E;p.tls.hmac_sha1=function(v,I,F){var M=p.hmac.create();M.start("SHA1",v);v=p.util.createBuffer();v.putInt32(I[0]);
544v.putInt32(I[1]);v.putByte(F.type);v.putByte(F.version.major);v.putByte(F.version.minor);v.putInt16(F.length);v.putBytes(F.fragment.bytes());M.update(v.getBytes());return M.digest().getBytes()};p.tls.createSessionCache=a.createSessionCache;p.tls.createConnection=a.createConnection},
544"./lib/util.js":function(K,r,C){(function(p){function E(d){if(d!==8&&d!==16&&d!==24&&d!==32)throw Error("Only 8, 16, 24, or 32 bits supported: "+d);}function O(d){this.data="";this.read=0;if(typeof d==="string")this.data=
545d;else if(c.isArrayBuffer(d)||c.isArrayBufferView(d))if(typeof Buffer!=="undefined"&&d instanceof Buffer)this.data=d.toString("binary");else{d=new Uint8Array(d);try{this.data=String.fromCharCode.apply(null,d)}catch(A){for(var q=0;q<d.length;++q)this.putByte(d[q])}}else if(d instanceof O||typeof d==="object"&&typeof d.data==="string"&&typeof d.read==="number")this.data=d.data,this.read=d.read;this._constructedStringLength=0}var y=C("./lib/forge.js"),l=C("./lib/baseN.js"),c=K.exports=y.util=y.util||
546{};(function(){if(typeof process!=="undefined"&&process.nextTick&&!process.browser)c.nextTick=process.nextTick,c.setImmediate=typeof setImmediate==="function"?setImmediate:c.nextTick;else if(typeof setImmediate==="function")c.setImmediate=function(){return setImmediate.apply(void 0,arguments)},c.nextTick=function(k){return setImmediate(k)};else{c.setImmediate=function(k){setTimeout(k,0)};if(typeof window!=="undefined"&&typeof window.postMessage==="function"){var d=[];c.setImmediate=function(k){d.push(k);
547d.length===1&&window.postMessage("forge.setImmediate","*")};window.addEventListener("message",function(k){k.source===window&&k.data==="forge.setImmediate"&&(k.stopPropagation(),k=d.slice(),d.length=0,k.forEach(function(w){w()}))},!0)}if(typeof MutationObserver!=="undefined"){var q=Date.now(),A=!0,D=document.createElement("div");d=[];(new MutationObserver(function(){var k=d.slice();d.length=0;k.forEach(function(w){w()})})).observe(D,{attributes:!0});var J=c.setImmediate;c.setImmediate=function(k){Date.now()-
548q>15?(q=Date.now(),J(k)):(d.push(k),d.length===1&&D.setAttribute("a",A=!A))}}c.nextTick=c.setImmediate}})();c.isNodejs=typeof process!=="undefined"&&process.versions&&process.versions.node;p=c.isNodejs?p:typeof self==="undefined"?window:self;c.globalScope=p;c.isArray=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"};c.isArrayBuffer=function(d){return typeof ArrayBuffer!=="undefined"&&d instanceof ArrayBuffer};c.isArrayBufferView=function(d){return d&&c.isArrayBuffer(d.buffer)&&
549d.byteLength!==void 0};c.ByteBuffer=O;c.ByteStringBuffer=O;c.ByteStringBuffer.prototype._optimizeConstructedString=function(d){this._constructedStringLength+=d;this._constructedStringLength>4096&&(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(d){return this.putBytes(String.fromCharCode(d))};
550c.ByteStringBuffer.prototype.fillWithByte=function(d,q){d=String.fromCharCode(d);for(var A=this.data;q>0;)q&1&&(A+=d),q>>>=1,q>0&&(d+=d);this.data=A;this._optimizeConstructedString(q);return this};c.ByteStringBuffer.prototype.putBytes=function(d){this.data+=d;this._optimizeConstructedString(d.length);return this};c.ByteStringBuffer.prototype.putString=function(d){return this.putBytes(c.encodeUtf8(d))};c.ByteStringBuffer.prototype.putInt16=function(d){return this.putBytes(String.fromCharCode(d>>8&
551255)+String.fromCharCode(d&255))};c.ByteStringBuffer.prototype.putInt24=function(d){return this.putBytes(String.fromCharCode(d>>16&255)+String.fromCharCode(d>>8&255)+String.fromCharCode(d&255))};c.ByteStringBuffer.prototype.putInt32=function(d){return this.putBytes(String.fromCharCode(d>>24&255)+String.fromCharCode(d>>16&255)+String.fromCharCode(d>>8&255)+String.fromCharCode(d&255))};c.ByteStringBuffer.prototype.putInt16Le=function(d){return this.putBytes(String.fromCharCode(d&255)+String.fromCharCode(d>>
5528&255))};c.ByteStringBuffer.prototype.putInt24Le=function(d){return this.putBytes(String.fromCharCode(d&255)+String.fromCharCode(d>>8&255)+String.fromCharCode(d>>16&255))};c.ByteStringBuffer.prototype.putInt32Le=function(d){return this.putBytes(String.fromCharCode(d&255)+String.fromCharCode(d>>8&255)+String.fromCharCode(d>>16&255)+String.fromCharCode(d>>24&255))};c.ByteStringBuffer.prototype.putInt=function(d,q){E(q);var A="";do q-=8,A+=String.fromCharCode(d>>q&255);while(q>0);return this.putBytes(A)};
553c.ByteStringBuffer.prototype.putSignedInt=function(d,q){d<0&&(d+=2<<q-1);return this.putInt(d,q)};c.ByteStringBuffer.prototype.putBuffer=function(d){return this.putBytes(d.getBytes())};c.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};c.ByteStringBuffer.prototype.getInt16=function(){var d=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);this.read+=2;return d};c.ByteStringBuffer.prototype.getInt24=function(){var d=this.data.charCodeAt(this.read)<<
55416^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);this.read+=3;return d};c.ByteStringBuffer.prototype.getInt32=function(){var d=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);this.read+=4;return d};c.ByteStringBuffer.prototype.getInt16Le=function(){var d=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;this.read+=2;return d};c.ByteStringBuffer.prototype.getInt24Le=
555function(){var d=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;this.read+=3;return d};c.ByteStringBuffer.prototype.getInt32Le=function(){var d=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;this.read+=4;return d};c.ByteStringBuffer.prototype.getInt=function(d){E(d);var q=0;do q=(q<<8)+this.data.charCodeAt(this.read++),d-=8;while(d>0);return q};
556c.ByteStringBuffer.prototype.getSignedInt=function(d){var q=this.getInt(d);d=2<<d-2;q>=d&&(q-=d<<1);return q};c.ByteStringBuffer.prototype.getBytes=function(d){if(d){d=Math.min(this.length(),d);var q=this.data.slice(this.read,this.read+d);this.read+=d}else d===0?q="":(q=this.read===0?this.data:this.data.slice(this.read),this.clear());return q};c.ByteStringBuffer.prototype.bytes=function(d){return typeof d==="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+d)};c.ByteStringBuffer.prototype.at=
557function(d){return this.data.charCodeAt(this.read+d)};c.ByteStringBuffer.prototype.setAt=function(d,q){this.data=this.data.substr(0,this.read+d)+String.fromCharCode(q)+this.data.substr(this.read+d+1);return this};c.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};c.ByteStringBuffer.prototype.copy=function(){var d=c.createBuffer(this.data);d.read=this.read;return d};c.ByteStringBuffer.prototype.compact=function(){this.read>0&&(this.data=this.data.slice(this.read),
558this.read=0);return this};c.ByteStringBuffer.prototype.clear=function(){this.data="";this.read=0;return this};c.ByteStringBuffer.prototype.truncate=function(d){d=Math.max(0,this.length()-d);this.data=this.data.substr(this.read,d);this.read=0;return this};c.ByteStringBuffer.prototype.toHex=function(){for(var d="",q=this.read;q<this.data.length;++q){var A=this.data.charCodeAt(q);A<16&&(d+="0");d+=A.toString(16)}return d};c.ByteStringBuffer.prototype.toString=function(){return c.decodeUtf8(this.bytes())};
559c.DataBuffer=function(d,q){q=q||{};this.read=q.readOffset||0;this.growSize=q.growSize||1024;var A=c.isArrayBuffer(d),D=c.isArrayBufferView(d);A||D?(this.data=A?new DataView(d):new DataView(d.buffer,d.byteOffset,d.byteLength),this.write="writeOffset"in q?q.writeOffset:this.data.byteLength):(this.data=new DataView(new ArrayBuffer(0)),this.write=0,d!==null&&d!==void 0&&this.putBytes(d),"writeOffset"in q&&(this.write=q.writeOffset))};c.DataBuffer.prototype.length=function(){return this.write-this.read};
560c.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};c.DataBuffer.prototype.accommodate=function(d,q){if(this.length()>=d)return this;q=Math.max(q||this.growSize,d);d=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength);q=new Uint8Array(this.length()+q);q.set(d);this.data=new DataView(q.buffer);return this};c.DataBuffer.prototype.putByte=function(d){this.accommodate(1);this.data.setUint8(this.write++,d);return this};c.DataBuffer.prototype.fillWithByte=function(d,
561q){this.accommodate(q);for(var A=0;A<q;++A)this.data.setUint8(d);return this};c.DataBuffer.prototype.putBytes=function(d,q){if(c.isArrayBufferView(d)){q=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);d=q.byteLength-q.byteOffset;this.accommodate(d);var A=new Uint8Array(this.data.buffer,this.write);A.set(q);this.write+=d;return this}if(c.isArrayBuffer(d))return q=new Uint8Array(d),this.accommodate(q.byteLength),A=new Uint8Array(this.data.buffer),A.set(q,this.write),this.write+=q.byteLength,this;
562if(d instanceof c.DataBuffer||typeof d==="object"&&typeof d.read==="number"&&typeof d.write==="number"&&c.isArrayBufferView(d.data))return q=new Uint8Array(d.data.byteLength,d.read,d.length()),this.accommodate(q.byteLength),A=new Uint8Array(d.data.byteLength,this.write),A.set(q),this.write+=q.byteLength,this;d instanceof c.ByteStringBuffer&&(d=d.data,q="binary");q=q||"binary";if(typeof d==="string"){if(q==="hex")return this.accommodate(Math.ceil(d.length/2)),q=new Uint8Array(this.data.buffer,this.write),
563this.write+=c.binary.hex.decode(d,q,this.write),this;
563if(q==="base64")return this.accommodate(Math.ceil(d.length/4)*3),q=new Uint8Array(this.data.buffer,this.write),this.write+=c.binary.base64.decode(d,q,this.write),this;q==="utf8"&&(d=c.encodeUtf8(d),q="binary");if(q==="binary"||q==="raw")return this.accommodate(d.length),q=new Uint8Array(this.data.buffer,this.write),this.write+=c.binary.raw.decode(q),this;if(q==="utf16")return this.accommodate(d.length*2),q=new Uint16Array(this.data.buffer,this.write),
564this.write+=c.text.utf16.encode(q),this;throw Error("Invalid encoding: "+q);}throw Error("Invalid parameter: "+d);};c.DataBuffer.prototype.putBuffer=function(d){this.putBytes(d);d.clear();return this};c.DataBuffer.prototype.putString=function(d){return this.putBytes(d,"utf16")};c.DataBuffer.prototype.putInt16=function(d){this.accommodate(2);this.data.setInt16(this.write,d);this.write+=2;return this};c.DataBuffer.prototype.putInt24=function(d){this.accommodate(3);this.data.setInt16(this.write,d>>8&
56565535);this.data.setInt8(this.write,d>>16&255);this.write+=3;return this};c.DataBuffer.prototype.putInt32=function(d){this.accommodate(4);this.data.setInt32(this.write,d);this.write+=4;return this};c.DataBuffer.prototype.putInt16Le=function(d){this.accommodate(2);this.data.setInt16(this.write,d,!0);this.write+=2;return this};c.DataBuffer.prototype.putInt24Le=function(d){this.accommodate(3);this.data.setInt8(this.write,d>>16&255);this.data.setInt16(this.write,d>>8&65535,!0);this.write+=3;return this};
566c.DataBuffer.prototype.putInt32Le=function(d){this.accommodate(4);this.data.setInt32(this.write,d,!0);this.write+=4;return this};c.DataBuffer.prototype.putInt=function(d,q){E(q);this.accommodate(q/8);do q-=8,this.data.setInt8(this.write++,d>>q&255);while(q>0);return this};c.DataBuffer.prototype.putSignedInt=function(d,q){E(q);this.accommodate(q/8);d<0&&(d+=2<<q-1);return this.putInt(d,q)};c.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};c.DataBuffer.prototype.getInt16=
567function(){var d=this.data.getInt16(this.read);this.read+=2;return d};c.DataBuffer.prototype.getInt24=function(){var d=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);this.read+=3;return d};c.DataBuffer.prototype.getInt32=function(){var d=this.data.getInt32(this.read);this.read+=4;return d};c.DataBuffer.prototype.getInt16Le=function(){var d=this.data.getInt16(this.read,!0);this.read+=2;return d};c.DataBuffer.prototype.getInt24Le=function(){var d=this.data.getInt8(this.read)^this.data.getInt16(this.read+
5681,!0)<<8;this.read+=3;return d};c.DataBuffer.prototype.getInt32Le=function(){var d=this.data.getInt32(this.read,!0);this.read+=4;return d};c.DataBuffer.prototype.getInt=function(d){E(d);var q=0;do q=(q<<8)+this.data.getInt8(this.read++),d-=8;while(d>0);return q};c.DataBuffer.prototype.getSignedInt=function(d){var q=this.getInt(d);d=2<<d-2;q>=d&&(q-=d<<1);return q};c.DataBuffer.prototype.getBytes=function(d){if(d){d=Math.min(this.length(),d);var q=this.data.slice(this.read,this.read+d);this.read+=
569d}else d===0?q="":(q=this.read===0?this.data:this.data.slice(this.read),this.clear());return q};c.DataBuffer.prototype.bytes=function(d){return typeof d==="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+d)};c.DataBuffer.prototype.at=function(d){return this.data.getUint8(this.read+d)};c.DataBuffer.prototype.setAt=function(d,q){this.data.setUint8(d,q);return this};c.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};c.DataBuffer.prototype.copy=function(){return new c.DataBuffer(this)};
570c.DataBuffer.prototype.compact=function(){if(this.read>0){var d=new Uint8Array(this.data.buffer,this.read),q=new Uint8Array(d.byteLength);q.set(d);this.data=new DataView(q);this.write-=this.read;this.read=0}return this};c.DataBuffer.prototype.clear=function(){this.data=new DataView(new ArrayBuffer(0));this.read=this.write=0;return this};c.DataBuffer.prototype.truncate=function(d){this.write=Math.max(0,this.length()-d);this.read=Math.min(this.read,this.write);return this};c.DataBuffer.prototype.toHex=
571function(){for(var d="",q=this.read;q<this.data.byteLength;++q){var A=this.data.getUint8(q);A<16&&(d+="0");d+=A.toString(16)}return d};c.DataBuffer.prototype.toString=function(d){var q=new Uint8Array(this.data,this.read,this.length());d=d||"utf8";if(d==="binary"||d==="raw")return c.binary.raw.encode(q);if(d==="hex")return c.binary.hex.encode(q);if(d==="base64")return c.binary.base64.encode(q);if(d==="utf8")return c.text.utf8.decode(q);if(d==="utf16")return c.text.utf16.decode(q);throw Error("Invalid encoding: "+
572d);};c.createBuffer=function(d,q){d!==void 0&&(q||"raw")==="utf8"&&(d=c.encodeUtf8(d));return new c.ByteBuffer(d)};c.fillString=function(d,q){for(var A="";q>0;
572)q&1&&(A+=d),q>>>=1,q>0&&(d+=d);return A};c.xorBytes=function(d,q,A){for(var D="",J,k="",w=0,f=0;A>0;--A,++w)J=d.charCodeAt(w)^q.charCodeAt(w),f>=10&&(D+=k,k="",f=0),k+=String.fromCharCode(J),++f;return D+k};c.hexToBytes=function(d){var q="",A=0;d.length&1&&(A=1,q+=String.fromCharCode(parseInt(d[0],16)));for(;A<d.length;A+=2)q+=String.fromCharCode(parseInt(d.substr(A,
5732),16));return q};c.bytesToHex=function(d){return c.createBuffer(d).toHex()};c.int32ToBytes=function(d){return String.fromCharCode(d>>24&255)+String.fromCharCode(d>>16&255)+String.fromCharCode(d>>8&255)+String.fromCharCode(d&255)};var a=[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];c.encode64=function(d,q){for(var A=
574"",D="",J,k,w,f=0;f<d.length;)J=d.charCodeAt(f++),k=d.charCodeAt(f++),w=d.charCodeAt(f++),A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(J>>2),A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((J&3)<<4|k>>4),isNaN(k)?A+="==":(A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((k&15)<<2|w>>6),A+=isNaN(w)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(w&63)),q&&A.length>q&&(D+=A.substr(0,
575q)+"\r\n",A=A.substr(q));return D+A};c.decode64=function(d){d=d.replace(/[^A-Za-z0-9\+\/=]/g,"");for(var q="",A,D,J,k,w=0;w<d.length;)A=a[d.charCodeAt(w++)-43],D=a[d.charCodeAt(w++)-43],J=a[d.charCodeAt(w++)-43],k=a[d.charCodeAt(w++)-43],q+=String.fromCharCode(A<<2|D>>4),J!==64&&(q+=String.fromCharCode((D&15)<<4|J>>2),k!==64&&(q+=String.fromCharCode((J&3)<<6|k)));return q};c.encodeUtf8=function(d){return unescape(encodeURIComponent(d))};c.decodeUtf8=function(d){return decodeURIComponent(escape(d))};
576c.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:l.encode,decode:l.decode}};c.binary.raw.encode=function(d){return String.fromCharCode.apply(null,d)};c.binary.raw.decode=function(d,q,A){var D=q;D||(D=new Uint8Array(d.length));for(var J=A=A||0,k=0;k<d.length;++k)D[J++]=d.charCodeAt(k);return q?J-A:D};c.binary.hex.encode=c.bytesToHex;c.binary.hex.decode=function(d,q,A){var D=q;D||(D=new Uint8Array(Math.ceil(d.length/2)));A=A||0;var J=0,k=A;d.length&1&&(J=1,D[k++]=parseInt(d[0],16));for(;J<
577d.length;J+=2)D[k++]=parseInt(d.substr(J,2),16);return q?k-A:D};c.binary.base64.encode=function(d,q){for(var A="",D="",J,k,w,f=0;f<d.byteLength;)J=d[f++],k=d[f++],w=d[f++],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(J>>2),A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((J&3)<<4|k>>4),isNaN(k)?A+="==":(A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((k&15)<<2|w>>6),A+=isNaN(w)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(w&
57863)),q&&A.length>q&&(D+=A.substr(0,q)+"\r\n",A=A.substr(q));return D+A};c.binary.base64.decode=function(d,q,A){var D=q;D||(D=new Uint8Array(Math.ceil(d.length/4)*3));d=d.replace(/[^A-Za-z0-9\+\/=]/g,"");A=A||0;for(var J,k,w,f,e=0,m=A;e<d.length;)J=a[d.charCodeAt(e++)-43],k=a[d.charCodeAt(e++)-43],w=a[d.charCodeAt(e++)-43],f=a[d.charCodeAt(e++)-43],D[m++]=J<<2|k>>4,w!==64&&(D[m++]=(k&15)<<4|w>>2,f!==64&&(D[m++]=(w&3)<<6|f));return q?m-A:D.subarray(0,m)};c.binary.base58.encode=function(d,q){return c.binary.baseN.encode(d,
579"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",q)};c.binary.base58.decode=function(d,q){return c.binary.baseN.decode(d,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",q)};c.text={utf8:{},utf16:{}};c.text.utf8.encode=function(d,q,A){d=c.encodeUtf8(d);var D=q;D||(D=new Uint8Array(d.length));for(var J=A=A||0,k=0;k<d.length;++k)D[J++]=d.charCodeAt(k);return q?J-A:D};c.text.utf8.decode=function(d){return c.decodeUtf8(String.fromCharCode.apply(null,d))};c.text.utf16.encode=function(d,
580q,A){var D=q;D||(D=new Uint8Array(d.length*2));for(var J=new Uint16Array(D.buffer),k=A=A||0,w=A,f=0;f<d.length;
580++f)J[w++]=d.charCodeAt(f),k+=2;return q?k-A:D};c.text.utf16.decode=function(d){return String.fromCharCode.apply(null,new Uint16Array(d.buffer))};c.deflate=function(d,q,A){q=c.decode64(d.deflate(c.encode64(q)).rval);A&&(d=2,q.charCodeAt(1)&32&&(d=6),q=q.substring(d,q.length-4));return q};c.inflate=function(d,q,A){d=d.inflate(c.encode64(q)).rval;return d===null?null:c.decode64(d)};var b=function(d,
581q,A){if(!d)throw Error("WebStorage not available.");A===null?d=d.removeItem(q):(A=c.encode64(JSON.stringify(A)),d=d.setItem(q,A));if(typeof d!=="undefined"&&d.rval!==!0)throw q=Error(d.error.message),q.id=d.error.id,q.name=d.error.name,q;},g=function(d,q){if(!d)throw Error("WebStorage not available.");q=d.getItem(q);if(d.init)if(q.rval===null){if(q.error)throw d=Error(q.error.message),d.id=q.error.id,d.name=q.error.name,d;q=null}else q=q.rval;q!==null&&(q=JSON.parse(c.decode64(q)));return q},u=function(d,
582q,A,D){var J=g(d,q);J===null&&(J={});J[A]=D;b(d,q,J)},G=function(d,q,A){d=g(d,q);d!==null&&(d=A in d?d[A]:null);return d},h=function(d,q,A){var D=g(d,q);if(D!==null&&A in D){delete D[A];A=!0;for(var J in D){A=!1;break}A&&(D=null);b(d,q,D)}},B=function(d,q){b(d,q,null)},t=function(d,q,A){var D=null;typeof A==="undefined"&&(A=["web","flash"]);var J=!1,k=null,w;for(w in A){var f=A[w];try{if(f==="flash"||f==="both"){if(q[0]===null)throw Error("Flash local storage not available.");D=d.apply(this,q);J=
583f==="flash"}if(f==="web"||f==="both")q[0]=localStorage,D=d.apply(this,q),J=!0}catch(e){k=e}if(J)break}if(!J)throw k;return D};c.setItem=function(d,q,A,D,J){t(u,arguments,J)};c.getItem=function(d,q,A,D){return t(G,arguments,D)};c.removeItem=function(d,q,A,D){t(h,arguments,D)};c.clearItems=function(d,q,A){t(B,arguments,A)};c.isEmpty=function(d){for(var q in d)if(d.hasOwnProperty(q))return!1;return!0};c.format=function(d){var q=/%./g,A,D,J=0,k=[];for(D=0;A=q.exec(d);)switch(D=d.substring(D,q.lastIndex-
5842),D.length>0&&k.push(D),D=q.lastIndex,A=A[0][1],A){case "s":case "o":J<arguments.length?k.push(arguments[J++ +1]):k.push("<?>");break;case "%":k.push("%");break;default:k.push("<%"+A+"?>")}k.push(d.substring(D));return k.join("")};c.formatNumber=function(d,q,A,D){var J=isNaN(q=Math.abs(q))?2:q;q=A===void 0?",":A;D=D===void 0?".":D;A=d<0?"-":"";var k=parseInt(d=Math.abs(+d||0).toFixed(J),10)+"",w=k.length>3?k.length%3:0;return A+(w?k.substr(0,w)+D:"")+k.substr(w).replace(/(\d{3})(?=\d)/g,"$1"+D)+
585(J?q+Math.abs(d-k).toFixed(J).slice(2):"")};c.formatSize=function(d){return d=d>=1073741824?c.formatNumber(d/1073741824,2,".","")+" GiB":d>=1048576?c.formatNumber(d/1048576,2,".","")+" MiB":d>=1024?c.formatNumber(d/1024,0)+" KiB":c.formatNumber(d,0)+" bytes"};c.bytesFromIP=function(d){return d.indexOf(".")!==-1?c.bytesFromIPv4(d):d.indexOf(":")!==-1?c.bytesFromIPv6(d):null};c.bytesFromIPv4=function(d){d=d.split(".");if(d.length!==4)return null;for(var q=c.createBuffer(),A=0;A<d.length;++A){var D=
586parseInt(d[A],10);if(isNaN(D))return null;q.putByte(D)}return q.getBytes()};c.bytesFromIPv6=function(d){var q=0;d=d.split(":").filter(function(w){w.length===0&&++q;return!0});for(var A=(8-d.length+q)*2,D=c.createBuffer(),J=0;J<8;++J)if(d[J]&&d[J].length!==0){var k=c.hexToBytes(d[J]);k.length<2&&D.putByte(0);D.putBytes(k)}else D.fillWithByte(0,A),A=0;return D.getBytes()};c.bytesToIP=function(d){return d.length===4?c.bytesToIPv4(d):d.length===16?c.bytesToIPv6(d):null};c.bytesToIPv4=function(d){if(d.length!==
5874)return null;for(var q=[],A=0;A<d.length;++A)q.push(d.charCodeAt(A));return q.join(".")};c.bytesToIPv6=function(d){if(d.length!==16)return null;for(var q=[],A=[],D=0,J=0;J<d.length;J+=2){for(var k=c.bytesToHex(d[J]+d[J+1]);k[0]==="0"&&k!=="0";)k=k.substr(1);if(k==="0"){var w=A[A.length-1],f=q.length;w&&f===w.end+1?(w.end=f,w.end-w.start>A[D].end-A[D].start&&(D=A.length-1)):A.push({start:f,end:f})}q.push(k)}A.length>0&&(d=A[D],d.end-d.start>0&&(q.splice(d.start,d.end-d.start+1,""),d.start===0&&q.unshift(""),
588d.end===7&&q.push("")));return q.join(":")};c.estimateCores=function(d,q){function A(w,f,e){if(f===0){var m=Math.floor(w.reduce(function(x,H){return x+H}
588,0)/w.length);c.cores=Math.max(1,m);URL.revokeObjectURL(k);return q(null,c.cores)}D(e,function(x,H){w.push(J(e,H));A(w,f-1,e)})}function D(w,f){for(var e=[],m=[],x=0;x<w;++x){var H=new Worker(k);H.addEventListener("message",function(L){m.push(L.data);if(m.length===w){for(L=0;L<w;++L)e[L].terminate();f(null,m)}});e.push(H)}for(x=0;x<w;++x)e[x].postMessage(x)}
589function J(w,f){for(var e=[],m=0;m<w;++m)for(var x=f[m],H=e[m]=[],L=0;L<w;++L)if(m!==L){var P=f[L];(x.st>P.st&&x.st<P.et||P.st>x.st&&P.st<x.et)&&H.push(L)}return e.reduce(function(Q,S){return Math.max(Q,S.length)},0)}typeof d==="function"&&(q=d,d={});d=d||{};if("cores"in c&&!d.update)return q(null,c.cores);if(typeof navigator!=="undefined"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return c.cores=navigator.hardwareConcurrency,q(null,c.cores);if(typeof Worker==="undefined")return c.cores=
5901,q(null,c.cores);if(typeof Blob==="undefined")return c.cores=2,q(null,c.cores);var k=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(w){w=Date.now();for(var f=w+4;Date.now()<f;);self.postMessage({st:w,et:f})})}.toString(),")()"],{type:"application/javascript"}));A([],5,16)}}).call(this,C("./node_modules/webpack/buildin/global.js"))},
590"./lib/x509.js":function(K,r,C){function p(k,w){typeof w==="string"&&(w={shortName:w});for(var f=null,e,m=0;f===null&&m<k.attributes.length;++m)e=
591k.attributes[m],w.type&&w.type===e.type?f=e:w.name&&w.name===e.name?f=e:w.shortName&&w.shortName===e.shortName&&(f=e);return f}function E(k){var w=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]);k=k.attributes;for(var f=0;f<k.length;++f){var e=k[f];var m=e.value,x=b.Type.PRINTABLESTRING;"valueTagClass"in e&&(x=e.valueTagClass,x===b.Type.UTF8&&(m=a.util.encodeUtf8(m)));e=b.create(b.Class.UNIVERSAL,b.Type.SET,!0,[b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,
592!1,b.oidToDer(e.type).getBytes()),b.create(b.Class.UNIVERSAL,x,!1,m)])]);w.value.push(e)}return w}function O(k){for(var w,f=0;f<k.length;++f){w=k[f];typeof w.name==="undefined"&&(w.type&&w.type in g.oids?w.name=g.oids[w.type]:w.shortName&&w.shortName in G&&(w.name=g.oids[G[w.shortName]]));if(typeof w.type==="undefined")if(w.name&&w.name in g.oids)w.type=g.oids[w.name];else throw k=Error("Attribute type not specified."),k.attribute=w,k;typeof w.shortName==="undefined"&&w.name&&w.name in G&&(w.shortName=
593G[w.name]);if(w.type===u.extensionRequest&&(w.valueConstructed=!0,w.valueTagClass=b.Type.SEQUENCE,!w.value&&w.extensions)){w.value=[];for(var e=0;e<w.extensions.length;++e)w.value.push(g.certificateExtensionToAsn1(y(w.extensions[e])))}if(typeof w.value==="undefined")throw k=Error("Attribute value not specified."),k.attribute=w,k;}}function y(k,w){w=w||{};typeof k.name==="undefined"&&k.id&&k.id in g.oids&&(k.name=g.oids[k.id]);if(typeof k.id==="undefined")if(k.name&&k.name in g.oids)k.id=g.oids[k.name];
594else{var f=Error("Extension ID not specified.");f.extension=k;throw f;}if(typeof k.value!=="undefined")return k;if(k.name==="keyUsage"){var e=f=w=0;k.digitalSignature&&(f|=128,w=7);k.nonRepudiation&&(f|=64,w=6);k.keyEncipherment&&(f|=32,w=5);k.dataEncipherment&&(f|=16,w=4);k.keyAgreement&&(f|=8,w=3);k.keyCertSign&&(f|=4,w=2);k.cRLSign&&(f|=2,w=1);k.encipherOnly&&(f|=1,w=0);k.decipherOnly&&(e|=128,w=7);w=String.fromCharCode(w);e!==0?w+=String.fromCharCode(f)+String.fromCharCode(e):f!==0&&(w+=String.fromCharCode(f));
595k.value=b.create(b.Class.UNIVERSAL,b.Type.BITSTRING,!1,w)}else if(k.name==="basicConstraints")k.value=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]),k.cA&&k.value.value.push(b.create(b.Class.UNIVERSAL,b.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in k&&k.value.value.push(b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,b.integerToDer(k.pathLenConstraint).getBytes()));else if(k.name==="extKeyUsage")for(e in k.value=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]),f=k.value.value,
596k)k[e]===!0&&(e in u?f.push(b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(u[e]).getBytes())):e.indexOf(".")!==-1&&f.push(b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(e).getBytes())));else if(k.name==="nsCertType")f=w=0,k.client&&(f|=128,w=7),k.server&&(f|=64,w=6),k.email&&(f|=32,w=5),k.objsign&&(f|=16,w=4),k.reserved&&(f|=8,w=3),k.sslCA&&(f|=4,w=2),k.emailCA&&(f|=2,w=1),k.objCA&&(f|=1,w=0),w=String.fromCharCode(w),f!==0&&(w+=String.fromCharCode(f)),k.value=b.create(b.Class.UNIVERSAL,
597b.Type.BITSTRING,!1,w);else if(k.name==="subjectAltName"||k.name==="issuerAltName"){k.value=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]);for(var m=0;m<k.altNames.length;++m){e=k.altNames[m];w=e.value;if(e.type===7&&e.ip){if(w=a.util.bytesFromIP(e.ip),w===null)throw f=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.'),f.extension=k,f;}else e.type===8&&(w=e.oid?b.oidToDer(b.oidToDer(e.oid)):b.oidToDer(w));k.value.value.push(b.create(b.Class.CONTEXT_SPECIFIC,e.type,!1,w))}}else if(k.name===
598"nsComment"&&w.cert){if(!/^[\x00-\x7F]*$/.test(k.comment)||k.comment.length<1||k.comment.length>128)throw Error('Invalid "nsComment" content.');k.value=b.create(b.Class.UNIVERSAL,b.Type.IA5STRING,!1,k.comment)}else if(k.name==="subjectKeyIdentifier"&&w.cert)f=w.cert.generateSubjectKeyIdentifier(),k.subjectKeyIdentifier=f.toHex(),k.value=b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,f.getBytes());else if(k.name==="authorityKeyIdentifier"&&w.cert)k.value=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,
599!0,[]),f=k.value.value,k.keyIdentifier&&(e=k.keyIdentifier===!0?w.cert.generateSubjectKeyIdentifier().getBytes():k.keyIdentifier,f.push(b.create(b.Class.CONTEXT_SPECIFIC,0,!1,e))),k.authorityCertIssuer&&(e=[b.create(b.Class.CONTEXT_SPECIFIC,4,!0,[E(k.authorityCertIssuer===!0?w.cert.issuer:k.authorityCertIssuer)])],f.push(b.create(b.Class.CONTEXT_SPECIFIC,1,!0,e))),k.serialNumber&&(w=a.util.hexToBytes(k.seri
599alNumber===!0?w.cert.serialNumber:k.serialNumber),f.push(b.create(b.Class.CONTEXT_SPECIFIC,
6002,!1,w)));else if(k.name==="cRLDistributionPoints"){k.value=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]);f=k.value.value;var x=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]),H=b.create(b.Class.CONTEXT_SPECIFIC,0,!0,[]);for(m=0;m<k.altNames.length;++m){e=k.altNames[m];w=e.value;if(e.type===7&&e.ip){if(w=a.util.bytesFromIP(e.ip),w===null)throw f=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.'),f.extension=k,f;}else e.type===8&&(w=e.oid?b.oidToDer(b.oidToDer(e.oid)):b.oidToDer(w));
601H.value.push(b.create(b.Class.CONTEXT_SPECIFIC,e.type,!1,w))}x.value.push(b.create(b.Class.CONTEXT_SPECIFIC,0,!0,[H]));f.push(x)}if(typeof k.value==="undefined")throw f=Error("Extension value not specified."),f.extension=k,f;return k}function l(k,w){switch(k){case u["RSASSA-PSS"]:return k=[],w.hash.algorithmOid!==void 0&&k.push(b.create(b.Class.CONTEXT_SPECIFIC,0,!0,[b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(w.hash.algorithmOid).getBytes()),
602b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,"")])])),w.mgf.algorithmOid!==void 0&&k.push(b.create(b.Class.CONTEXT_SPECIFIC,1,!0,[b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(w.mgf.algorithmOid).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(w.mgf.hash.algorithmOid).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,"")])])])),w.saltLength!==void 0&&k.push(b.create(b.Class.CONTEXT_SPECIFIC,
6032,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,b.integerToDer(w.saltLength).getBytes())])),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,k);default:return b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,"")}}function c(k){return k>=D&&k<J?b.create(b.Class.UNIVERSAL,b.Type.UTCTIME,!1,b.dateToUtcTime(k)):b.create(b.Class.UNIVERSAL,b.Type.GENERALIZEDTIME,!1,b.dateToGeneralizedTime(k))}var a=C("./lib/forge.js");C("./lib/aes.js");C("./lib/asn1.js");C("./lib/des.js");C("./lib/md.js");C("./lib/mgf.js");C("./lib/oids.js");
604C("./lib/pem.js");C("./lib/pss.js");C("./lib/rsa.js");C("./lib/util.js");var b=a.asn1,g=K.exports=a.pki=a.pki||{},u=g.oids,G={};G.CN=u.commonName;G.commonName="CN";G.C=u.countryName;G.countryName="C";G.L=u.localityName;G.localityName="L";G.ST=u.stateOrProvinceName;G.stateOrProvinceName="ST";G.O=u.organizationName;G.organizationName="O";G.OU=u.organizationalUnitName;G.organizationalUnitName="OU";G.E=u.emailAddress;G.emailAddress="E";K=a.pki.rsa.publicKeyValidator;var h={name:"Certificate",tagClass:b.Class.UNIVERSAL,
605type:b.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:b.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:b.Class.UNIVERSAL,
606type:b.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:b.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",
607tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:b.Class.UNIVERSAL,type:b.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:b.Class.UNIVERSAL,type:b.Type.GENERALIZEDTIME,constructed:!1,
608optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:b.Class.UNIVERSAL,type:b.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:b.Class.UNIVERSAL,type:b.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,
609captureAsn1:"certSubject"},K,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:b.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:b.Class.UNIVERSAL,type:b.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:b.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:b.Class.UNIVERSAL,
610type:b.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:b.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",
611tagClass:b.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParam
611s"}]},{name:"Certificate.signatureValue",tagClass:b.Class.UNIVERSAL,type:b.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},B={name:"rsapss",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:b.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:b.Class.UNIVERSAL,type:b.Class.SEQUENCE,constructed:!0,
612optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:b.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:b.Class.UNIVERSAL,type:b.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,
613capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:b.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:b.Class.UNIVERSAL,type:b.Class.INTEGER,constructed:!1,capture:"saltLength"}]},
614{name:"rsapss.trailerField",tagClass:b.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:b.Class.UNIVERSAL,type:b.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},t={name:"CertificationRequest",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[{name:"CertificationRequestInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",
615tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},K,{name:"CertificationRequestInfo.attributes",tagClass:b.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,
616constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:b.Class.UNIVERSAL,type:b.Type.SET,constructed:!0}]}]}]},{name:"CertificationRequest.signatureAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"csrSignatureOid"},
617{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:b.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:b.Class.UNIVERSAL,type:b.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};g.RDNAttributesAsArray=function(k,w){for(var f=[],e,m,x,H=0;H<k.value.length;++H){e=k.value[H];for(var L=0;L<e.value.length;++L)x={},m=e.value[L],x.type=b.derToOid(m.value[0].value),x.value=m.value[1].value,x.valueTagClass=m.value[1].type,
618x.type in u&&(x.name=u[x.type],x.name in G&&(x.shortName=G[x.name])),w&&(w.update(x.type),w.update(x.value)),f.push(x)}return f};g.CRIAttributesAsArray=function(k){for(var w=[],f=0;f<k.length;++f){var e=k[f],m=b.derToOid(e.value[0].value);e=e.value[1].value;for(var x=0;x<e.length;++x){var H={};H.type=m;H.value=e[x].value;H.valueTagClass=e[x].type;H.type in u&&(H.name=u[H.type],H.name in G&&(H.shortName=G[H.name]));if(H.type===u.extensionRequest){H.extensions=[];for(var L=0;L<H.value.length;++L)H.extensions.push(g.certificateExtensionFromAsn1(H.value[L]))}w.push(H)}}return w};
619var d=function(k,w,f){var e={};if(k!==u["RSASSA-PSS"])return e;f&&(e={hash:{algorithmOid:u.sha1},mgf:{algorithmOid:u.mgf1,hash:{algorithmOid:u.sha1}},saltLength:20});f={};k=[];if(!b.validate(w,B,f,k))throw w=Error("Cannot read RSASSA-PSS parameter block."),w.errors=k,w;f.hashOid!==void 0&&(e.hash=e.hash||{},e.hash.algorithmOid=b.derToOid(f.hashOid));f.maskGenOid!==void 0&&(e.mgf=e.mgf||{},e.mgf.algorithmOid=b.derToOid(f.maskGenOid),e.mgf.hash=e.mgf.hash||{},e.mgf.hash.algorithmOid=b.derToOid(f.maskGenHashOid));
620f.saltLength!==void 0&&(e.saltLength=f.saltLength.charCodeAt(0));return e},q=function(k){switch(u[k.signatureOid]){case "sha1WithRSAEncryption":case "sha1WithRSASignature":return a.md.sha1.create();case "md5WithRSAEncryption":return a.md.md5.create();case "sha256WithRSAEncryption":return a.md.sha256.create();case "sha384WithRSAEncryption":return a.md.sha384.create();case "sha512WithRSAEncryption":return a.md.sha512.create();case "RSASSA-PSS":return a.md.sha256.create();default:var w=Error("Could not compute "+
621k.type+" digest. Unknown signature OID.");w.signatureOid=k.signatureOid;throw w;}},A=function(k){var w=k.certificate;switch(w.signatureOid){case u.sha1WithRSAEncryption:case u.sha1WithRSASignature:break;case u["RSASSA-PSS"]:var f=u[w.signatureParameters.mgf.hash.algorithmOid];if(f===void 0||a.md[f]===void 0)throw k=Error("Unsupported MGF hash function."),k.oid=w.signatureParameters.mgf.hash.algorithmOid,k.name=f,k;var e=u[w.signatureParameters.mgf.algorithmOid];if(e===void 0||a.mgf[e]===void 0)throw k=
622Error("Unsupported MGF function."),k.oid=w.signatureParameters.mgf.algorithmOid,k.name=e,k;e=a.mgf[e].create(a.md[f].create());f=u[w.signatureParameters.hash.algorithmOid];if(f===void 0||a.md[f]===void 0)throw k=Error("Unsupported RSASSA-PSS hash function."),k.oid=w.signatureParameters.hash.algorithmOid,k.name=f,k;f=a.pss.create(a.md[f].create(),e,w.signatureParameters.saltLength)}return w.publicKey.verify(k.md.digest().getBytes(),k.signature,f)};g.certificateFromPem=function(k,w,f){k=a.pem.decode(k)[0];
623if(k.type!=="CERTIFICATE"&&k.type!=="X509 CERTIFICATE"&&k.type!=="TRUSTED CERTIFICATE")throw w=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'),w.headerType=k.type,w;if(k.procType&&k.procType.type==="ENCRYPTED")throw Error("Could not convert certificate from PEM; PEM is encrypted.");f=b.fromDer(k.body,f);return g.certificateFromAsn1(f,w)};g.certificateToPem=function(k,w){k={type:"CERTIFICATE",body:b.toDer(g.certificateToAsn1(k)).getBytes()};
624return a.pem.encode(k,{maxline:w})};g.publicKeyFromPem=function(k){k=a.pem.decode(k)[0];if(k.type!=="PUBLIC KEY"&&k.type!=="RSA PUBLIC KEY"){var w=Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');w.headerType=k.type;throw w;}if(k.procType&&k.procType.type==="ENCRYPTED")throw Error("Could not convert public key from PEM; PEM is encrypted.");k=b.fromDer(k.body);return g.publicKeyFromAsn1(k)};g.publicKeyToPem=function(k,w){k={type:"PUBLIC KEY",
625body:b.toDer(g.publicKeyToAsn1(k)).getBytes()};return a.pem.encode(k,{maxline:w})};g.publicKeyToRSAPublicKeyPem=function(k,w){k={type:"RSA PUBLIC KEY",body:b.toDer(g.publicKeyToRSAPublicKey(k)).getBytes()};return a.pem.encode(k,{maxline:w})};g.getPublicKeyFingerprint=function(k,w){w=w||{};var f=w.md||a.md.sha1.create();switch(w.type||"RSAPublicKey"){case "RSAPublicKey":k=b.toDer(g.publicKeyToRSAPublicKey(k)).getBytes();break;case "SubjectPublicKeyInfo":k=b.toDer(g.publicKeyToAsn1(k)).getBytes();break;
626default:throw Error('Unknown fingerprint type "'+w.type+'".');}f.start();f.update(k);f=f.digest();if(w.encoding==="hex")return f=f.toHex(),w.delimiter?f.match(/.{2}/g).join(w.delimiter):f;if(w.encoding==="binary")return f.getBytes();if(w.encoding)throw Error('Unknown encoding "'+w.encoding+'".');return f};g.certificationRequestFromPem=function(k,w,f){k=a.pem.decode(k)[0];if(k.type!=="CERTIFICATE REQUEST")throw w=Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".'),
627w.headerType=k.type,w;if(k.procType&&k.procType.type==="ENCRYPTED")throw Error("Could not convert certification request from PEM; PEM is encrypted.");f=b.fromDer(k.body,f);return g.certificationRequestFromAsn1(f,w)};g.certificationRequestToPem=function(k,w){k={type:"CERTIFICATE REQUEST",body:b.toDer(g.certificationRequestToAsn1(k)).getBytes()};return a.pem.encode(k,{maxline:w})};g.createCertificate=function(){var k={version:2,serialNumber:"00",signatureOid:null,
627signature:null,siginfo:{}};k.siginfo.algorithmOid=
628null;k.validity={};k.validity.notBefore=new Date;k.validity.notAfter=new Date;k.issuer={};k.issuer.getField=function(w){return p(k.issuer,w)};k.issuer.addField=function(w){O([w]);k.issuer.attributes.push(w)};k.issuer.attributes=[];k.issuer.hash=null;k.subject={};k.subject.getField=function(w){return p(k.subject,w)};k.subject.addField=function(w){O([w]);k.subject.attributes.push(w)};k.subject.attributes=[];k.subject.hash=null;k.extensions=[];k.publicKey=null;k.md=null;k.setSubject=function(w,f){O(w);
629k.subject.attributes=w;delete k.subject.uniqueId;f&&(k.subject.uniqueId=f);k.subject.hash=null};k.setIssuer=function(w,f){O(w);k.issuer.attributes=w;delete k.issuer.uniqueId;f&&(k.issuer.uniqueId=f);k.issuer.hash=null};k.setExtensions=function(w){for(var f=0;f<w.length;++f)y(w[f],{cert:k});k.extensions=w};k.getExtension=function(w){typeof w==="string"&&(w={name:w});for(var f=null,e,m=0;f===null&&m<k.extensions.length;++m)e=k.extensions[m],w.id&&e.id===w.id?f=e:w.name&&e.name===w.name&&(f=e);return f};
630k.sign=function(w,f){k.md=f||a.md.sha1.create();f=u[k.md.algorithm+"WithRSAEncryption"];if(!f)throw w=Error("Could not compute certificate digest. Unknown message digest algorithm OID."),w.algorithm=k.md.algorithm,w;k.signatureOid=k.siginfo.algorithmOid=f;k.tbsCertificate=g.getTBSCertificate(k);f=b.toDer(k.tbsCertificate);k.md.update(f.getBytes());k.signature=w.sign(k.md)};k.verify=function(w){var f=!1;if(!k.issued(w))throw w=w.issuer,f=Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject."),
631f.expectedIssuer=k.subject.attributes,f.actualIssuer=w.attributes,f;var e=w.md;if(e===null){e=q({signatureOid:w.signatureOid,type:"certificate"});var m=w.tbsCertificate||g.getTBSCertificate(w);m=b.toDer(m);e.update(m.getBytes())}e!==null&&(f=A({certificate:k,md:e,signature:w.signature}));return f};k.isIssuer=function(w){var f=!1,e=k.issuer;w=w.subject;if(e.hash&&w.hash)f=e.hash===w.hash;else if(e.attributes.length===w.attributes.length){f=!0;for(var m,x,H=0;f&&H<e.attributes.length;++H)if(m=e.attributes[H],
632x=w.attributes[H],m.type!==x.type||m.value!==x.value)f=!1}return f};k.issued=function(w){return w.isIssuer(k)};k.generateSubjectKeyIdentifier=function(){return g.getPublicKeyFingerprint(k.publicKey,{type:"RSAPublicKey"})};k.verifySubjectKeyIdentifier=function(){for(var w=u.subjectKeyIdentifier,f=0;f<k.extensions.length;++f){var e=k.extensions[f];if(e.id===w)return w=k.generateSubjectKeyIdentifier().getBytes(),a.util.hexToBytes(e.subjectKeyIdentifier)===w}return!1};return k};g.certificateFromAsn1=
633function(k,w){var f={},e=[];if(!b.validate(k,h,f,e))throw f=Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate."),f.errors=e,f;if(b.derToOid(f.publicKeyOid)!==g.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var m=g.createCertificate();m.version=f.certVersion?f.certVersion.charCodeAt(0):0;e=a.util.createBuffer(f.certSerialNumber);m.serialNumber=e.toHex();m.signatureOid=a.asn1.derToOid(f.certSignatureOid);m.signatureParameters=d(m.signatureOid,
634f.certSignatureParams,!0);m.siginfo.algorithmOid=a.asn1.derToOid(f.certinfoSignatureOid);m.siginfo.parameters=d(m.siginfo.algorithmOid,f.certinfoSignatureParams,!1);m.signature=f.certSignature;e=[];f.certValidity1UTCTime!==void 0&&e.push(b.utcTimeToDate(f.certValidity1UTCTime));f.certValidity2GeneralizedTime!==void 0&&e.push(b.generalizedTimeToDate(f.certValidity2GeneralizedTime));f.certValidity3UTCTime!==void 0&&e.push(b.utcTimeToDate(f.certValidity3UTCTime));f.certValidity4GeneralizedTime!==void 0&&
635e.push(b.generalizedTimeToDate(f.certValidity4GeneralizedTime));if(e.length>2)throw Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(e.length<2)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");m.validity.notBefore=e[0];m.validity.notAfter=e[1];m.tbsCertificate=f.tbsCertificate;w&&(m.md=q({signatureOid:m.signatureOid,type:"certificate"}),w=b.toDer(m.tbsCertificate),
636m.md.update(w.getBytes()));w=a.md.sha1.create();e=b.toDer(f.certIssuer);w.update(e.getBytes());m.issuer.getField=function(x){return p(m.issuer,x)};m.issuer.addField=function(x){O([x]);m.issuer.attributes.push(x)};m.issuer.attributes=g.RDNAttributesAsArray(f.certIssuer);f.certIssuerUniqueId&&(m.issuer.uniqueId=f.certIssuerUniqueId);m.issuer.hash=w.digest().toHex();w=a.md.sha1.create();e=b.toDer(f.certSubject);w.update(e.getBytes());m.subject.getField=function(x){return p(m.subject,x)};
636m.subject.addField=
637function(x){O([x]);m.subject.attributes.push(x)};m.subject.attributes=g.RDNAttributesAsArray(f.certSubject);f.certSubjectUniqueId&&(m.subject.uniqueId=f.certSubjectUniqueId);m.subject.hash=w.digest().toHex();m.extensions=f.certExtensions?g.certificateExtensionsFromAsn1(f.certExtensions):[];m.publicKey=g.publicKeyFromAsn1(f.subjectPublicKeyInfo);return m};g.certificateExtensionsFromAsn1=function(k){for(var w=[],f=0;f<k.value.length;++f)for(var e=k.value[f],m=0;m<e.value.length;++m)w.push(g.certificateExtensionFromAsn1(e.value[m]));
638return w};g.certificateExtensionFromAsn1=function(k){var w={};w.id=b.derToOid(k.value[0].value);w.critical=!1;k.value[1].type===b.Type.BOOLEAN?(w.critical=k.value[1].value.charCodeAt(0)!==0,w.value=k.value[2].value):w.value=k.value[1].value;if(w.id in u)if(w.name=u[w.id],w.name==="keyUsage"){k=b.fromDer(w.value);var f=0,e=0;k.value.length>1&&(f=k.value.charCodeAt(1),e=k.value.length>2?k.value.charCodeAt(2):0);w.digitalSignature=(f&128)===128;w.nonRepudiation=(f&64)===64;w.keyEncipherment=(f&32)===
63932;w.dataEncipherment=(f&16)===16;w.keyAgreement=(f&8)===8;w.keyCertSign=(f&4)===4;w.cRLSign=(f&2)===2;w.encipherOnly=(f&1)===1;w.decipherOnly=(e&128)===128}else if(w.name==="basicConstraints")k=b.fromDer(w.value),w.cA=k.value.length>0&&k.value[0].type===b.Type.BOOLEAN?k.value[0].value.charCodeAt(0)!==0:!1,f=null,k.value.length>0&&k.value[0].type===b.Type.INTEGER?f=k.value[0].value:k.value.length>1&&(f=k.value[1].value),f!==null&&(w.pathLenConstraint=b.derToInteger(f));else if(w.name==="extKeyUsage")for(k=
640b.fromDer(w.value),f=0;f<k.value.length;++f)e=b.derToOid(k.value[f].value),e in u?w[u[e]]=!0:w[e]=!0;else if(w.name==="nsCertType")k=b.fromDer(w.value),f=0,k.value.length>1&&(f=k.value.charCodeAt(1)),w.client=(f&128)===128,w.server=(f&64)===64,w.email=(f&32)===32,w.objsign=(f&16)===16,w.reserved=(f&8)===8,w.sslCA=(f&4)===4,w.emailCA=(f&2)===2,w.objCA=(f&1)===1;else if(w.name==="subjectAltName"||w.name==="issuerAltName")for(w.altNames=[],k=b.fromDer(w.value),e=0;e<k.value.length;++e){f=k.value[e];
641var m={type:f.type,value:f.value};w.altNames.push(m);switch(f.type){case 7:m.ip=a.util.bytesToIP(f.value);break;case 8:m.oid=b.derToOid(f.value)}}else w.name==="subjectKeyIdentifier"&&(k=b.fromDer(w.value),w.subjectKeyIdentifier=a.util.bytesToHex(k.value));return w};g.certificationRequestFromAsn1=function(k,w){var f={},e=[];if(!b.validate(k,t,f,e))throw f=Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest."),f.errors=e,f;if(b.derToOid(f.publicKeyOid)!==
642g.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var m=g.createCertificationRequest();m.version=f.csrVersion?f.csrVersion.charCodeAt(0):0;m.signatureOid=a.asn1.derToOid(f.csrSignatureOid);m.signatureParameters=d(m.signatureOid,f.csrSignatureParams,!0);m.siginfo.algorithmOid=a.asn1.derToOid(f.csrSignatureOid);m.siginfo.parameters=d(m.siginfo.algorithmOid,f.csrSignatureParams,!1);m.signature=f.csrSignature;m.certificationRequestInfo=f.certificationRequestInfo;w&&(m.md=q({signatureOid:m.signatureOid,
643type:"certification request"}),e=b.toDer(m.certificationRequestInfo),m.md.update(e.getBytes()));e=a.md.sha1.create();m.subject.getField=function(x){return p(m.subject,x)};m.subject.addField=function(x){O([x]);m.subject.attributes.push(x)};m.subject.attributes=g.RDNAttributesAsArray(f.certificationRequestInfoSubject,e);m.subject.hash=e.digest().toHex();m.publicKey=g.publicKeyFromAsn1(f.subjectPublicKeyInfo);m.getAttribute=function(x){return p(m,x)};m.addAttribute=function(x){O([x]);m.attributes.push(x)};
644m.attributes=g.CRIAttributesAsArray(f.certificationRequestInfoAttributes||[]);return m};g.createCertificationRequest=function(){var k={version:0,signatureOid:null,signature:null,siginfo:{}};k.siginfo.algorithmOid=null;k.subject={};k.subject.getField=function(w){return p(k.subject,w)};k.subject.addField=function(w){O([w]);k.subject.attributes.push(w)};k.subject.attributes=[];k.subject.hash=null;k.publicKey=null;k.attributes=[];k.getAttribute=function(w){return p(k,w)};k.addAttribute=function(w){O([w]);
645k.attributes.push(w)};k.md=null;k.setSubject=function(w){O(w);k.subject.attributes=w;k.subject.hash=null};k.setAttributes=function(w){O(w);k.attributes=w};k.sign=function(w,f){k.md=f||a.md.sha1.create();f=u[k.md.algorithm+"WithRSAEncryption"];if(!f)throw w=Error("Could not compute certification request digest. Unknown message digest algorithm OID."),w.algorithm=k.md.algorithm,w;k.signatureOid=k.siginfo.algorithmOid=f;k.certificationRequestInfo=g.getCertificationRequestInfo(k);f=b.toDer(k.certificationRequestInfo);
646k.md.update(f.getBytes());k.signature=w.sign(k.md)};k.verify=function(){var w=!1,f=k.md;if(f===null){f=q({signatureOid:k.signatureOid,type:"certification request"});var e=k.certificationRequestInfo||g.getCertificationRequestInfo(k);e=b.toDer(e);f.update(e.getBytes())}f!==null&&(w=A({certificate:k,md:f,signature:k.signature}));return w};return k};var D=new Date("1950-01-01T00:00:00Z"),J=new Date("2050-01-01T00:00:00Z");g.getTBSCertificate=function(k){var w=c(k.validity.notBefore),f=c(k.validity.notAfter);
647w=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.CONTEXT_SPECIFIC,0,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,b.integerToDer(k.version).getBytes())]),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,a.util.hexToBytes(k.seri
647alNumber)),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(k.siginfo.algorithmOid).getBytes()),l(k.siginfo.algorithmOid,k.siginfo.parameters)]),E(k.issuer),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[w,f]),
648E(k.subject),g.publicKeyToAsn1(k.publicKey)]);k.issuer.uniqueId&&w.value.push(b.create(b.Class.CONTEXT_SPECIFIC,1,!0,[b.create(b.Class.UNIVERSAL,b.Type.BITSTRING,!1,String.fromCharCode(0)+k.issuer.uniqueId)]));k.subject.uniqueId&&w.value.push(b.create(b.Class.CONTEXT_SPECIFIC,2,!0,[b.create(b.Class.UNIVERSAL,b.Type.BITSTRING,!1,String.fromCharCode(0)+k.subject.uniqueId)]));k.extensions.length>0&&w.value.push(g.certificateExtensionsToAsn1(k.extensions));return w};g.getCertificationRequestInfo=function(k){var w=
649b,f=w.create,e=b.Class.UNIVERSAL,m=b.Type.SEQUENCE,x=b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,b.integerToDer(k.version).getBytes()),H=E(k.subject),L=g.publicKeyToAsn1(k.publicKey);var P=b.create(b.Class.CONTEXT_SPECIFIC,0,!0,[]);if(k.attributes.length!==0){k=k.attributes;for(var Q=0;Q<k.length;++Q){var S=k[Q],V=S.value,v=b.Type.UTF8;"valueTagClass"in S&&(v=S.valueTagClass);v===b.Type.UTF8&&(V=a.util.encodeUtf8(V));var I=!1;"valueConstructed"in S&&(I=S.valueConstructed);S=b.create(b.Class.UNIVERSAL,
650b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(S.type).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.SET,!0,[b.create(b.Class.UNIVERSAL,v,I,V)])]);P.value.push(S)}}return f.call(w,e,m,!0,[x,H,L,P])};g.distinguishedNameToAsn1=function(k){return E(k)};g.certificateToAsn1=function(k){var w=k.tbsCertificate||g.getTBSCertificate(k);return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[w,b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(k.signatureOid).getBytes()),
651l(k.signatureOid,k.signatureParameters)]),b.create(b.Class.UNIVERSAL,b.Type.BITSTRING,!1,String.fromCharCode(0)+k.signature)])};g.certificateExtensionsToAsn1=function(k){var w=b.create(b.Class.CONTEXT_SPECIFIC,3,!0,[]),f=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]);w.value.push(f);for(var e=0;e<k.length;++e)f.value.push(g.certificateExtensionToAsn1(k[e]));return w};g.certificateExtensionToAsn1=function(k){var w=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]);w.value.push(b.create(b.Class.UNIVERSAL,
652b.Type.OID,!1,b.oidToDer(k.id).getBytes()));k.critical&&w.value.push(b.create(b.Class.UNIVERSAL,b.Type.BOOLEAN,!1,String.fromCharCode(255)));var f=k.value;typeof k.value!=="string"&&(f=b.toDer(f).getBytes());w.value.push(b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,f));return w};g.certificationRequestToAsn1=function(k){var w=k.certificationRequestInfo||g.getCertificationRequestInfo(k);return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[w,b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,
653b.Type.OID,!1,b.oidToDer(k.signatureOid).getBytes()),l(k.signatureOid,k.signatureParameters)]),b.create(b.Class.UNIVERSAL,b.Type.BITSTRING,!1,String.fromCharCode(0)+k.signature)])};g.createCaStore=function(k){function w(x){f(x);return e.certs[x.hash]||null}function f(x){if(!x.hash){var H=a.md.sha1.create();x.attributes=g.RDNAttributesAsArray(E(x),H);x.hash=H.digest().toHex()}}var e={certs:{},getIssuer:function(x){return w(x.issuer)},addCertificate:function(x){typeof x==="string"&&(x=a.pki.certificateFromPem(x));
654f(x.subject);if(!e.hasCertificate(x))if(x.subject.hash in e.certs){var H=e.certs[x.subject.hash];a.util.isArray(H)||(H=[H]);H.push(x);e.certs[x.subject.hash]=H}else e.certs[x.subject.hash]=x},hasCertificate:function(x){typeof x==="string"&&(x=a.pki.certificateFromPem(x));var H=w(x.subject);if(!H)return!1;a.util.isArray(H)||(H=[H]);x=b.toDer(g.certificateToAsn1(x)).getBytes();for(var L=0;L<H.length;++L){var P=b.toDer(g.certificateToAsn1(H[L])).getBytes();if(x===P)return!0}return!1},listAllCertificates:function(){var x=
655[],H;for(H in e.certs)if(e.certs.hasOwnProperty(H)){var L=e.certs[H];if(a.util.isArray(L))for(var P=0;P<L.length;++P)x.push(L[P]);else x.push(L)}return x},removeCertificate:function(x){typeof x==="string"&&(x=a.pki.certificateFromPem(x));f(x.subject);if(!e.hasCertificate(x))return null;var H=w(x.subject);if(!a.util.isArray(H)){var L=e.certs[x.subject.hash];delete e.certs[x.subject.hash];return L}for(var P=b.toDer(g.certificateToAsn1(x)).getBytes(),Q=0;Q<H.length;++Q){var S=b.toDer(g.certificateToAsn1(H[Q])).getBytes();
656P===S&&(L=H[Q],H.splice(Q,1))}H.length===0&&delete e.certs[x.subject.hash];return L}};if(k)for(var m=0;m<k.length;++m)e.addCertificate(k[m]);return e};g.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};g.verifyCertificateChain=
657function(k,w,f){typeof f==="function"&&(f={verify:f});f=f||{};w=w.slice(0);var e=w.slice(0),m=f.validityCheckDate;typeof m==="undefined"&&(m=new Date);var x=!0,H=null,L=0;do{var P=w.shift(),Q=null,S=!1;m&&(m<P.validity.notBefore||m>
657P.validity.notAfter)&&(H={message:"Certificate is not valid yet or has expired.",error:g.certificateError.certificate_expired,notBefore:P.validity.notBefore,notAfter:P.validity.notAfter,now:m});if(H===null){Q=w[0]||k.getIssuer(P);Q===null&&P.isIssuer(P)&&(S=!0,Q=P);if(Q){var V=
658Q;a.util.isArray(V)||(V=[V]);for(var v=!1;!v&&V.length>0;){Q=V.shift();try{v=Q.verify(P)}catch(F){}}v||(H={message:"Certificate signature is invalid.",error:g.certificateError.bad_certificate})}H!==null||Q&&!S||k.hasCertificate(P)||(H={message:"Certificate is not trusted.",error:g.certificateError.unknown_ca})}H===null&&Q&&!P.isIssuer(Q)&&(H={message:"Certificate issuer is invalid.",error:g.certificateError.bad_certificate});if(H===null)for(V={keyUsage:!0,basicConstraints:!0},v=0;H===null&&v<P.extensions.length;++v){var I=
659P.extensions[v];!I.critical||I.name in V||(H={message:"Certificate has an unsupported critical extension.",error:g.certificateError.unsupported_certificate})}H!==null||x&&(w.length!==0||Q&&!S)||(x=P.getExtension("basicConstraints"),P=P.getExtension("keyUsage"),P!==null&&(P.keyCertSign&&x!==null||(H={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",
660error:g.certificateError.bad_certificate})),H===null&&x===null&&(H={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:g.certificateError.bad_certificate}),H!==null||x===null||x.cA||(H={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:g.certificateError.bad_certificate}),H===null&&P!==null&&"pathLenConstraint"in x&&L-1>x.pathLenConstraint&&(H={message:"Certificate basicConstraints pathLenConstraint violated.",error:g.certificateError.bad_certificate}));
661P=H===null?!0:H.error;x=f.verify?f.verify(P,L,e):P;if(x===!0)H=null;else{P===!0&&(H={message:"The application rejected the certificate.",error:g.certificateError.bad_certificate});if(x||x===0)typeof x!=="object"||a.util.isArray(x)?typeof x==="string"&&(H.error=x):(x.message&&(H.message=x.message),x.error&&(H.error=x.error));throw H;}x=!1;++L}while(w.length>0);return!0}},
vendor: 185 bytes, lines 661-662
661"./node_modules/webpack/buildin/global.js":function(K,r){r=function(){return this}();try{r=r||(new Function("return this"))()}catch(C){typeof window===
662"object"&&(r=window)}K.exports=r}
662,0:function(K,r,C){K.exports=C("./lib/index.js")},1:function(K,r){}})});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.