MCPcopy
hub / github.com/mailvelope/mailvelope / validKeyForAddress

Method validKeyForAddress

src/client-API/client-api.js:257–268  ·  view source on GitHub ↗

* Checks for valid key in the keyring for provided email addresses * If none is found also checks in other sources (see LookupResult). * @param {Array} recipients - list of email addresses for key lookup * @returns {Promise. } The object maps email addresses to: *

(recipients)

Source from the content-addressed store, hash-verified

255 * });
256 */
257 validKeyForAddress(recipients) {
258 return send('query-valid-key', {identifier: this.identifier, recipients}).then(keyMap => {
259 for (const address in keyMap) {
260 if (keyMap[address]) {
261 keyMap[address].keys.forEach(key => {
262 key.lastModified = new Date(key.lastModified);
263 });
264 }
265 }
266 return keyMap;
267 });
268 }
269
270 /**
271 * Exports the public key as an ascii armored string.

Callers 1

Calls 1

sendFunction · 0.70

Tested by

no test coverage detected