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

Method uploadSyncMessage

src/controller/sync.controller.js:157–171  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

155 }
156
157 async uploadSyncMessage(options) {
158 // if key is in cache, specific unlock of sign key packet might be required
159 const keyOptions = {
160 key: options.key,
161 password: options.password,
162 reason: 'PWD_DIALOG_REASON_EDITOR'
163 };
164 this.pwdControl = this.pwdControl || await createController('pwdDialog');
165 const unlockedKey = await this.pwdControl.unlockKey(keyOptions);
166 // encrypt keyring sync message
167 const armored = await encryptSyncMessage(unlockedKey.key, this.keyring.sync.data.changeLog, this.state.keyringId);
168 // upload
169 const {eTag} = await this.upload({eTag: this.keyring.sync.data.eTag, keyringMsg: armored});
170 this.keyring.sync.data.eTag = eTag;
171 }
172
173 /**
174 * Check if key can be unlocked without requesting the password from the user

Callers 1

triggerSyncMethod · 0.95

Calls 4

uploadMethod · 0.95
createControllerFunction · 0.90
encryptSyncMessageFunction · 0.90
unlockKeyMethod · 0.45

Tested by

no test coverage detected