MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / decryptFiles

Method decryptFiles

src/controller/editor.controller.js:415–437  ·  view source on GitHub ↗
(encFiles)

Source from the content-addressed store, hash-verified

413 }
414
415 async decryptFiles(encFiles) {
416 try {
417 const unlockKey = async options => {
418 const result = await this.unlockKey(options);
419 if (this.state.popupId) {
420 this.ports.editor.emit('hide-pwd-dialog');
421 }
422 return result;
423 };
424 await Promise.all(encFiles.map(async file => {
425 const {filename, data} = await model.decryptFile({
426 encryptedFile: {content: file.data, name: file.filename},
427 unlockKey,
428 uiLogSource: 'security_log_editor'
429 });
430 this.ports.editor.emit('set-attachment', {attachment: {content: data, filename, mimeType: file.mimeType}});
431 }));
432
433 this.ports.editor.emit('decrypt-end');
434 } catch (error) {
435 this.ports.editor.emit('decrypt-failed', {error: mapError(error)});
436 }
437 }
438
439 /**
440 * Receive plaintext from editor, initiate encryption

Callers 2

setAttachmentsMethod · 0.95
handleDecryptFunction · 0.80

Calls 3

mapErrorFunction · 0.90
decryptFileMethod · 0.80
emitMethod · 0.45

Tested by

no test coverage detected