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

Method generateKey

src/modules/KeyringLocal.js:323–336  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

321 }
322
323 async generateKey(options) {
324 const newKey = await super.generateKey(options);
325 if (options.unlocked) {
326 newKey.privateKey = await decryptKey({privateKey: newKey.privateKey, passphrase: options.passphrase});
327 }
328 await this.sync.add(newKey.privateKey.getFingerprint(), keyringSync.INSERT);
329 await this.keystore.store();
330 await this.sync.commit();
331 // if no default key in the keyring set the generated key as default
332 if (!await this.hasDefaultKey()) {
333 await this.setDefaultKey(newKey.privateKey.getFingerprint());
334 }
335 return newKey;
336 }
337}

Callers

nothing calls this directly

Calls 5

addMethod · 0.80
commitMethod · 0.80
hasDefaultKeyMethod · 0.80
storeMethod · 0.45
setDefaultKeyMethod · 0.45

Tested by

no test coverage detected