* Find key or sub key packet by keyId and return fingerprint * @param {String} keyId * @return {String}
(keyId)
| 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); |
no test coverage detected