diff --git a/relay-reactjs-chat/asset-manifest.json b/relay-reactjs-chat/asset-manifest.json index 6473b45..77c1318 100644 --- a/relay-reactjs-chat/asset-manifest.json +++ b/relay-reactjs-chat/asset-manifest.json @@ -1,13 +1,13 @@ { "files": { "main.css": "/relay-reactjs-chat/static/css/main.e6c13ad2.css", - "main.js": "/relay-reactjs-chat/static/js/main.264de85d.js", + "main.js": "/relay-reactjs-chat/static/js/main.2971b165.js", "index.html": "/relay-reactjs-chat/index.html", "main.e6c13ad2.css.map": "/relay-reactjs-chat/static/css/main.e6c13ad2.css.map", - "main.264de85d.js.map": "/relay-reactjs-chat/static/js/main.264de85d.js.map" + "main.2971b165.js.map": "/relay-reactjs-chat/static/js/main.2971b165.js.map" }, "entrypoints": [ "static/css/main.e6c13ad2.css", - "static/js/main.264de85d.js" + "static/js/main.2971b165.js" ] } \ No newline at end of file diff --git a/relay-reactjs-chat/index.html b/relay-reactjs-chat/index.html index 0a9e841..54b8d26 100644 --- a/relay-reactjs-chat/index.html +++ b/relay-reactjs-chat/index.html @@ -1 +1 @@ -
>>4|y<<28)^e[w+1];f=g,g=y,y=f^(o[E>>>24&63]|c[E>>>16&63]|u[E>>>8&63]|d[63&E]|s[_>>>24&63]|a[_>>>16&63]|l[_>>>8&63]|h[63&_])}f=g,g=y,y=f}y=y>>>1|y<<31,y^=f=1431655765&((g=g>>>1|g<<31)>>>1^y),y^=(f=16711935&(y>>>8^(g^=f<<1)))<<8,y^=(f=858993459&(y>>>2^(g^=f)))<<2,y^=f=65535&((g^=f)>>>16^y),y^=f=252645135&((g^=f<<16)>>>4^y),g^=f<<4,r[0]=g,r[1]=y}function p(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var s=null;r instanceof n.util.ByteBuffer&&(s=r,r={}),(r=r||{}).output=s,r.iv=e,i.call(t,r)},t}},3661:e=>{e.exports={options:{usePureJavaScript:!1}}},7542:(e,t,r)=>{var n=r(3661);r(6489),r(8312),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,s={start:function(s,o){if(null!==s)if("string"===typeof s){if(!((s=s.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+s+'"');t=n.md.algorithms[s].create()}else t=s;if(null===o)o=e;else{if("string"===typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var a=o;o=n.util.createBuffer();for(var c=0;c0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},s.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=T[T.length-1]){for(t=0;t{var n=r(3661);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function s(e,t){i[e]=t,i[t]=e}function o(e,t){i[e]=t}s("1.2.840.113549.1.1.1","rsaEncryption"),s("1.2.840.113549.1.1.4","md5WithRSAEncryption"),s("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),s("1.2.840.113549.1.1.7","RSAES-OAEP"),s("1.2.840.113549.1.1.8","mgf1"),s("1.2.840.113549.1.1.9","pSpecified"),s("1.2.840.113549.1.1.10","RSASSA-PSS"),s("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),s("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),s("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),s("1.3.101.112","EdDSA25519"),s("1.2.840.10040.4.3","dsa-with-sha1"),s("1.3.14.3.2.7","desCBC"),s("1.3.14.3.2.26","sha1"),s("1.3.14.3.2.29","sha1WithRSASignature"),s("2.16.840.1.101.3.4.2.1","sha256"),s("2.16.840.1.101.3.4.2.2","sha384"),s("2.16.840.1.101.3.4.2.3","sha512"),s("2.16.840.1.101.3.4.2.4","sha224"),s("2.16.840.1.101.3.4.2.5","sha512-224"),s("2.16.840.1.101.3.4.2.6","sha512-256"),s("1.2.840.113549.2.2","md2"),s("1.2.840.113549.2.5","md5"),s("1.2.840.113549.1.7.1","data"),s("1.2.840.113549.1.7.2","signedData"),s("1.2.840.113549.1.7.3","envelopedData"),s("1.2.840.113549.1.7.4","signedAndEnvelopedData"),s("1.2.840.113549.1.7.5","digestedData"),s("1.2.840.113549.1.7.6","encryptedData"),s("1.2.840.113549.1.9.1","emailAddress"),s("1.2.840.113549.1.9.2","unstructuredName"),s("1.2.840.113549.1.9.3","contentType"),s("1.2.840.113549.1.9.4","messageDigest"),s("1.2.840.113549.1.9.5","signingTime"),s("1.2.840.113549.1.9.6","counterSignature"),s("1.2.840.113549.1.9.7","challengePassword"),s("1.2.840.113549.1.9.8","unstructuredAddress"),s("1.2.840.113549.1.9.14","extensionRequest"),s("1.2.840.113549.1.9.20","friendlyName"),s("1.2.840.113549.1.9.21","localKeyId"),s("1.2.840.113549.1.9.22.1","x509Certificate"),s("1.2.840.113549.1.12.10.1.1","keyBag"),s("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),s("1.2.840.113549.1.12.10.1.3","certBag"),s("1.2.840.113549.1.12.10.1.4","crlBag"),s("1.2.840.113549.1.12.10.1.5","secretBag"),s("1.2.840.113549.1.12.10.1.6","safeContentsBag"),s("1.2.840.113549.1.5.13","pkcs5PBES2"),s("1.2.840.113549.1.5.12","pkcs5PBKDF2"),s("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),s("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),s("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),s("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),s("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),s("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),s("1.2.840.113549.2.7","hmacWithSHA1"),s("1.2.840.113549.2.8","hmacWithSHA224"),s("1.2.840.113549.2.9","hmacWithSHA256"),s("1.2.840.113549.2.10","hmacWithSHA384"),s("1.2.840.113549.2.11","hmacWithSHA512"),s("1.2.840.113549.3.7","des-EDE3-CBC"),s("2.16.840.1.101.3.4.1.2","aes128-CBC"),s("2.16.840.1.101.3.4.1.22","aes192-CBC"),s("2.16.840.1.101.3.4.1.42","aes256-CBC"),s("2.5.4.3","commonName"),s("2.5.4.4","surname"),s("2.5.4.5","serialNumber"),s("2.5.4.6","countryName"),s("2.5.4.7","localityName"),s("2.5.4.8","stateOrProvinceName"),s("2.5.4.9","streetAddress"),s("2.5.4.10","organizationName"),s("2.5.4.11","organizationalUnitName"),s("2.5.4.12","title"),s("2.5.4.13","description"),s("2.5.4.15","businessCategory"),s("2.5.4.17","postalCode"),s("2.5.4.42","givenName"),s("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),s("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),s("2.16.840.1.113730.1.1","nsCertType"),s("2.16.840.1.113730.1.13","nsComment"),o("2.5.29.1","authorityKeyIdentifier"),o("2.5.29.2","keyAttributes"),o("2.5.29.3","certificatePolicies"),o("2.5.29.4","keyUsageRestriction"),o("2.5.29.5","policyMapping"),o("2.5.29.6","subtreesConstraint"),o("2.5.29.7","subjectAltName"),o("2.5.29.8","issuerAltName"),o("2.5.29.9","subjectDirectoryAttributes"),o("2.5.29.10","basicConstraints"),o("2.5.29.11","nameConstraints"),o("2.5.29.12","policyConstraints"),o("2.5.29.13","basicConstraints"),s("2.5.29.14","subjectKeyIdentifier"),s("2.5.29.15","keyUsage"),o("2.5.29.16","privateKeyUsagePeriod"),s("2.5.29.17","subjectAltName"),s("2.5.29.18","issuerAltName"),s("2.5.29.19","basicConstraints"),o("2.5.29.20","cRLNumber"),o("2.5.29.21","cRLReason"),o("2.5.29.22","expirationDate"),o("2.5.29.23","instructionCode"),o("2.5.29.24","invalidityDate"),o("2.5.29.25","cRLDistributionPoints"),o("2.5.29.26","issuingDistributionPoint"),o("2.5.29.27","deltaCRLIndicator"),o("2.5.29.28","issuingDistributionPoint"),o("2.5.29.29","certificateIssuer"),o("2.5.29.30","nameConstraints"),s("2.5.29.31","cRLDistributionPoints"),s("2.5.29.32","certificatePolicies"),o("2.5.29.33","policyMappings"),o("2.5.29.34","policyConstraints"),s("2.5.29.35","authorityKeyIdentifier"),o("2.5.29.36","policyConstraints"),s("2.5.29.37","extKeyUsage"),o("2.5.29.46","freshestCRL"),o("2.5.29.54","inhibitAnyPolicy"),s("1.3.6.1.4.1.11129.2.4.2","timestampList"),s("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),s("1.3.6.1.5.5.7.3.1","serverAuth"),s("1.3.6.1.5.5.7.3.2","clientAuth"),s("1.3.6.1.5.5.7.3.3","codeSigning"),s("1.3.6.1.5.5.7.3.4","emailProtection"),s("1.3.6.1.5.5.7.3.8","timeStamping")},8665:(e,t,r)=>{var n=r(3661);if(r(6626),r(9443),r(3568),r(6489),r(1117),r(2854),r(7758),r(2776),r(5713),r(2194),r(8312),"undefined"===typeof i)var i=n.jsbn.BigInteger;var s=n.asn1,o=n.pki=n.pki||{};e.exports=o.pbe=n.pbe=n.pbe||{};var a=o.oids,c={name:"EncryptedPrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},l={name:"PBES2Algorithms",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},u={name:"pkcs-12PbeParams",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"iterations"}]};function h(e,t){return e.start().update(t).digest().getBytes()}function d(e){var t;if(e){if(!(t=o.oids[s.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return f(t)}function f(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}o.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,c,l,u=n.random.getBytesSync(r.saltSize),h=r.count,d=s.integerToDer(h);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,g,y;switch(r.algorithm){case"aes128":i=16,p=16,g=a["aes128-CBC"],y=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,g=a["aes192-CBC"],y=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,g=a["aes256-CBC"],y=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,g=a.desCBC,y=n.des.createEncryptionCipher;break;default:throw(_=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,_}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),v=f(m),b=n.pkcs5.pbkdf2(t,u,h,i,v),w=n.random.getBytesSync(p);(S=y(b)).start(w),S.update(s.toDer(e)),S.finish(),l=S.output.getBytes();var E=function(e,t,r,i){var a=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&a.value.push(s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(o.oids[i]).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]));return a}(u,d,i,m);c=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(a.pkcs5PBES2).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(a.pkcs5PBKDF2).getBytes()),E]),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(g).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,w)])])])}else{var _;if("3des"!==r.algorithm)throw(_=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,_;i=24;var S,I=new n.util.ByteBuffer(u);b=o.pbe.generatePkcs12Key(t,I,1,h,i),w=o.pbe.generatePkcs12Key(t,I,2,h,i);(S=n.des.createEncryptionCipher(b)).start(w),S.update(s.toDer(e)),S.finish(),l=S.output.getBytes(),c=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(a["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,u),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,d.getBytes())])])}return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[c,s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,l)])},o.decryptPrivateKeyInfo=function(e,t){var r=null,i={},a=[];if(!s.validate(e,c,i,a)){var l=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw l.errors=a,l}var u=s.derToOid(i.encryptionOid),h=o.pbe.getCipher(u,i.encryptionParams,t),d=n.util.createBuffer(i.encryptedData);return h.update(d),h.finish()&&(r=s.fromDer(h.output)),r},o.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:s.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},o.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return s.fromDer(t.body)},o.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=o.wrapRsaPrivateKey(o.privateKeyToAsn1(e));return i=o.encryptPrivateKeyInfo(i,t,r),o.encryptedPrivateKeyToPem(i)}var a,c,l,u;switch(r.algorithm){case"aes128":a="AES-128-CBC",l=16,c=n.random.getBytesSync(16),u=n.aes.createEncryptionCipher;break;case"aes192":a="AES-192-CBC",l=24,c=n.random.getBytesSync(16),u=n.aes.createEncryptionCipher;break;case"aes256":a="AES-256-CBC",l=32,c=n.random.getBytesSync(16),u=n.aes.createEncryptionCipher;break;case"3des":a="DES-EDE3-CBC",l=24,c=n.random.getBytesSync(8),u=n.des.createEncryptionCipher;break;case"des":a="DES-CBC",l=8,c=n.random.getBytesSync(8),u=n.des.createEncryptionCipher;break;default:var h=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw h.algorithm=r.algorithm,h}var d=u(n.pbe.opensslDeriveBytes(t,c.substr(0,8),l));d.start(c),d.update(s.toDer(o.privateKeyToAsn1(e))),d.finish();var f={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:a,parameters:n.util.bytesToHex(c).toUpperCase()},body:d.output.getBytes()};return n.pem.encode(f)},o.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(l=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=l,l;if(i.procType&&"ENCRYPTED"===i.procType.type){var a,c;switch(i.dekInfo.algorithm){case"DES-CBC":a=8,c=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,c=n.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,c=n.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,c=n.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,c=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,c=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":a=8,c=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":a=16,c=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var l;throw(l=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,l}var u=n.util.hexToBytes(i.dekInfo.parameters),h=c(n.pbe.opensslDeriveBytes(t,u.substr(0,8),a));if(h.start(u),h.update(n.util.createBuffer(i.body)),!h.finish())return r;r=h.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?o.decryptPrivateKeyInfo(s.fromDer(r),t):s.fromDer(r))&&(r=o.privateKeyFromAsn1(r)),r},o.pbe.generatePkcs12Key=function(e,t,r,i,s,o){var a,c;if("undefined"===typeof o||null===o){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');o=n.md.sha1.create()}var l=o.digestLength,u=o.blockLength,h=new n.util.ByteBuffer,d=new n.util.ByteBuffer;if(null!==e&&void 0!==e){for(c=0;c>24&255,o>>16&255,o>>8&255,255&o);r.start(),r.update(e+a),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,o,a,c;"string"===typeof r?(i=r,o=arguments[3]||void 0,a=arguments[4]||void 0):r&&(i=r.label||void 0,o=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),a?a.start():a=n.md.sha1.create(),c||(c=a);var l=Math.ceil(e.n.bitLength()/8),u=l-2*a.digestLength-2;if(t.length>u)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=t.length,y.maxLength=u,y;i||(i=""),a.update(i,"raw");for(var h=a.digest(),d="",f=u-t.length,p=0;p0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),s.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,s)),o.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),o])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var s=t.certificate;"string"===typeof s&&(s=n.pki.certificateFromPem(s)),r=s.issuer.attributes,i=s.serialNumber}var o=t.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"===typeof o&&(o=n.pki.privateKeyFromPem(o));var a=t.digestAlgorithm||n.pki.oids.sha1;switch(a){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+a)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var l=!1,u=!1,h=0;h>8*d-h&255;return(w=String.fromCharCode(w.charCodeAt(0)&~E)+w.substr(1))+g+String.fromCharCode(188)},verify:function(e,o,a){var c,l=a-1,u=Math.ceil(l/8);if(o=o.substr(-u),u>8*u-l&255;if(0!==(d.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var g=i.generate(f,h),y="";for(c=0;c0&&o.value.push(s.certificateExtensionsToAsn1(e.extensions)),o},s.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),m(e.subject),s.publicKeyToAsn1(e.publicKey),E(e)])},s.distinguishedNameToAsn1=function(e){return m(e)},s.certificateToAsn1=function(e){var t=e.tbsCertificate||s.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),w(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},s.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n