2 lines
2.1 KiB
JavaScript
2 lines
2.1 KiB
JavaScript
/*! OpenPGP.js v4.10.1 - 2020-02-27 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
|
|
!function(){return function e(n,t,r){function o(i,s){if(!t[i]){if(!n[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(a)return a(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var f=t[i]={exports:{}};n[i][0].call(f.exports,function(e){return o(n[i][1][e]||e)},f,f.exports,e,n,t,r)}return t[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}}()({1:[function(e,n,t){(function(e){importScripts("openpgp.min.js");var n=e.openpgp,t=[],r=6e4;n.crypto.random.randomBuffer.init(r,function(){return t.length||self.postMessage({event:"request-seed",amount:r}),new Promise(function(e){t.push(e)})}),self.onmessage=function(e){var r,s=e.data||{};switch(s.event){case"configure":r=s.config,Object.keys(r).forEach(function(e){n.config[e]=r[e]});break;case"seed-random":!function(e){e instanceof Uint8Array||(e=new Uint8Array(e));n.crypto.random.randomBuffer.set(e)}(s.buf);var u=t;t=[];for(var c=0;c<u.length;c++)u[c]();break;default:!function(e,t,r){if("clear-key-cache"===t)return Array.from(o.values()).forEach(e=>{e.isPrivate()&&e.clearPrivateParams()}),o.clear(),void i({id:e,event:"method-return"});if("function"!=typeof n[t])return void i({id:e,event:"method-return",err:"Unknown Worker Event"});n.util.restoreStreams(r),(r=n.packet.clone.parseClonedPackets(r,t)).publicKeys&&(r.publicKeys=r.publicKeys.map(a));r.privateKeys&&(r.privateKeys=r.privateKeys.map(a));n[t](r).then(function(t){i({id:e,event:"method-return",data:n.packet.clone.clonePackets(t)})}).catch(function(t){n.util.print_debug_error(t),i({id:e,event:"method-return",err:t.message,stack:t.stack})})}(s.id,s.event,s.options||{})}};const o=new Map;function a(e){const n=e.armor();return o.has(n)?o.get(n):(o.set(n,e),e)}function i(e){self.postMessage(e,n.util.getTransferables(e.data,!0))}postMessage({event:"loaded"})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); |