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

Method unlockKey

src/controller/decrypt.controller.js:191–207  ·  view source on GitHub ↗
({key, message})

Source from the content-addressed store, hash-verified

189 }
190
191 async unlockKey({key, message}) {
192 const pwdControl = await createController('pwdDialog');
193 const openPopup = this.ports.decryptCont || !await this.getPopup() && this.ports.dDialog;
194 const beforePasswordRequest = async id => await this.getPopup() && this.ports.dDialog.emit('show-pwd-dialog', {id});
195 const unlockedKey = await pwdControl.unlockKey({
196 key,
197 message,
198 reason: 'PWD_DIALOG_REASON_DECRYPT',
199 openPopup,
200 beforePasswordRequest
201 });
202 if (await this.getPopup()) {
203 this.ports.dDialog.emit('hide-pwd-dialog');
204 }
205 triggerSync({keyringId: this.keyringId, key: unlockedKey.key, password: unlockedKey.password});
206 return unlockedKey.key;
207 }
208}

Callers

nothing calls this directly

Calls 4

getPopupMethod · 0.95
createControllerFunction · 0.90
triggerSyncFunction · 0.90
emitMethod · 0.45

Tested by

no test coverage detected