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

Method getPrivateKeyByIds

src/modules/KeyringBase.js:235–245  ·  view source on GitHub ↗

* Return first private key that matches keyIds * @param {Array |openpgp.Keyid|String} keyIds - keyIds or fingerprints * @return {openpgp.key.Key|null}

(keyIds)

Source from the content-addressed store, hash-verified

233 * @return {openpgp.key.Key|null}
234 */
235 getPrivateKeyByIds(keyIds) {
236 keyIds = toArray(keyIds);
237 for (const keyId of keyIds) {
238 const keyIdHex = typeof keyId === 'string' ? keyId : keyId.toHex();
239 const key = this.keystore.privateKeys.getForId(keyIdHex, true);
240 if (key) {
241 return key;
242 }
243 }
244 return null;
245 }
246
247 /**
248 * Get keys by fingerprints

Callers 8

decryptMessageFunction · 0.80
logDecryptionFunction · 0.80
decryptFunction · 0.80
encryptFunction · 0.80
signFunction · 0.80
canUnlockKeyMethod · 0.80
downloadSyncMessageMethod · 0.80

Calls 3

toArrayFunction · 0.90
toHexMethod · 0.80
getForIdMethod · 0.80

Tested by

no test coverage detected