({keyringId, emailAddr})
| 70 | } |
| 71 | |
| 72 | async exportOwnPubKey({keyringId, emailAddr}) { |
| 73 | const keyring = await keyringById(keyringId); |
| 74 | const keyMap = await keyring.getKeyByAddress(emailAddr, {pub: false, priv: true, sort: true}); |
| 75 | const keyFprMap = mapAddressKeyMapToFpr(keyMap); |
| 76 | const pubKeyFprs = keyFprMap[emailAddr]; |
| 77 | if (!pubKeyFprs) { |
| 78 | throw new MvError('No key pair found for this email address.', 'NO_KEY_FOR_ADDRESS'); |
| 79 | } |
| 80 | // only take first valid key |
| 81 | const pubKeyFpr = pubKeyFprs[0]; |
| 82 | const armored = keyring.getArmoredKeys(pubKeyFpr, {pub: true}); |
| 83 | return armored[0].armoredPublic; |
| 84 | } |
| 85 | |
| 86 | async additionalHeadersForOutgoing({headers, keyringId}) { |
| 87 | const emailAddr = headers.from; |
nothing calls this directly
no test coverage detected