MCPcopy
hub / github.com/mailvelope/mailvelope / getFprForKeyId

Method getFprForKeyId

src/modules/KeyringBase.js:268–279  ·  view source on GitHub ↗

* Find key or sub key packet by keyId and return fingerprint * @param {String} keyId * @return {String}

(keyId)

Source from the content-addressed store, hash-verified

266 * @return {String}
267 */
268 getFprForKeyId(keyId) {
269 const keyArray = this.keystore.getKeysForId(keyId, true);
270 if (!keyArray) {
271 throw new MvError(`No key found for ID ${keyId}`, 'NO_KEY_FOUND_FOR_ID');
272 }
273 if (keyArray.length > 1) {
274 throw new MvError(`Collision of long key ID ${keyId}, more than one key found in keyring`, 'LONG_KEY_ID_COLLISION');
275 }
276 const key = keyArray[0];
277 const [{keyPacket}] = key.getKeys(key.keyPacket.keyID.constructor.fromID(keyId));
278 return keyPacket.getFingerprint();
279 }
280
281 getAttributes() {
282 return getKeyringAttr(this.id);

Callers 3

mapSignaturesFunction · 0.80
mapSignaturesFunction · 0.80

Calls 2

getKeysForIdMethod · 0.80
getKeysMethod · 0.80

Tested by

no test coverage detected