* Lookup a recipient's public key with the key registry sources and * store it locally using a TOFU like (trust on first use) mechanic. * @param {Object} msg The event message object * @return {undefined}
(msg)
| 270 | * @return {undefined} |
| 271 | */ |
| 272 | async onKeyLookup(msg) { |
| 273 | const result = await keyRegistry.lookup({query: {email: msg.recipient.email}, identity: this.state.keyringId}); |
| 274 | if (result) { |
| 275 | const keyring = await getKeyringById(this.state.keyringId); |
| 276 | await keyring.importKeys([{type: 'public', armored: result.armored}]); |
| 277 | } |
| 278 | await this.sendKeyUpdate(); |
| 279 | this.ports.editor.emit('key-lookup-result', {email: msg.recipient.email, found: Boolean(result)}); |
| 280 | } |
| 281 | |
| 282 | async sendKeyUpdate() { |
| 283 | // send updated key cache to editor |
nothing calls this directly
no test coverage detected