MCPcopy
hub / github.com/mailvelope/mailvelope / generate

Method generate

src/client-API/client-api.js:552–563  ·  view source on GitHub ↗

* Generate a private key * @param {Promise. } [confirm] - newly generate key is only persisted if Promise resolves, * in the reject or timeout case the generated key is rejected * @returns {Promise. } - the

(confirm)

Source from the content-addressed store, hash-verified

550 * @throws {Error}
551 */
552 generate(confirm) {
553 return send('generator-generate', {generatorId: this.generatorId, confirmRequired: Boolean(confirm)}).then(armored => {
554 if (confirm) {
555 confirm.then(() => {
556 emit('generator-generate-confirm', {generatorId: this.generatorId});
557 }).catch(e => {
558 emit('generator-generate-reject', {generatorId: this.generatorId, error: objError(e)});
559 });
560 }
561 return armored;
562 });
563 }
564}
565
566/**

Callers

nothing calls this directly

Calls 3

objErrorFunction · 0.85
sendFunction · 0.70
emitFunction · 0.70

Tested by

no test coverage detected