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

Method updateKey

src/modules/KeyringLocal.js:292–306  ·  view source on GitHub ↗
({srcKey, destKey, store = true})

Source from the content-addressed store, hash-verified

290 }
291
292 async updateKey({srcKey, destKey, store = true}) {
293 const fingerprint = srcKey.getFingerprint();
294 destKey ??= this.getPrivateKeyByFpr(fingerprint);
295 if (!destKey) {
296 throw new Error(`Key for update not found in store: ${fingerprint}`);
297 }
298 const updatedKey = await destKey.update(srcKey);
299 super.removeKey(fingerprint, destKey.isPrivate() ? 'private' : 'public');
300 this.addKey(updatedKey);
301 await this.sync.add(fingerprint, keyringSync.UPDATE);
302 if (store) {
303 await this.keystore.store();
304 await this.sync.commit();
305 }
306 }
307
308 isRFC2822UserId(user) {
309 const {userID} = UserIDPacket.fromObject(user.userID);

Callers 4

importPublicKeyMethod · 0.95
importPrivateKeyMethod · 0.95
revokeKeyMethod · 0.95
setKeyExDateMethod · 0.95

Calls 8

getPrivateKeyByFprMethod · 0.80
updateMethod · 0.80
isPrivateMethod · 0.80
addKeyMethod · 0.80
addMethod · 0.80
commitMethod · 0.80
removeKeyMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected