MCPcopy
hub / github.com/mailvelope/mailvelope / lookup

Function lookup

src/modules/autocryptWrapper.js:57–75  ·  view source on GitHub ↗
({email}, identity)

Source from the content-addressed store, hash-verified

55 * @return {String|undefined} The found armored key if any.
56 */
57export async function lookup({email}, identity) {
58 if (!email) {
59 return;
60 }
61 const ac = await autocrypt(identity);
62 return new Promise((resolve, reject) => {
63 ac.storage.get(email, (err, record) => {
64 if (err) {
65 reject(err);
66 } else {
67 const result = record && {
68 armored: armor(record.keydata),
69 date: new Date(record.last_seen_autocrypt)
70 };
71 resolve(result);
72 }
73 });
74 });
75}
76
77/**
78 * Process an autocrypt Header to store a public key.

Callers

nothing calls this directly

Calls 4

autocryptFunction · 0.85
armorFunction · 0.85
resolveFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected