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

Method syncKeyServer

src/controller/app.controller.js:179–196  ·  view source on GitHub ↗
({emails, fingerprint, keyringId, sync})

Source from the content-addressed store, hash-verified

177 }
178
179 async syncKeyServer({emails, fingerprint, keyringId, sync}) {
180 let result;
181 const keyring = await keyringById(keyringId);
182 const privateKey = keyring.getPrivateKeyByFpr(fingerprint);
183 if (sync) {
184 result = await mveloKeyServer.upload({emails, publicKeyArmored: privateKey.toPublic().armor()});
185 } else {
186 let options;
187 if (emails.length) {
188 options = {email: emails[0]};
189 } else {
190 const keyId = privateKey.getKeyID().toHex();
191 options = {keyId};
192 }
193 result = await mveloKeyServer.remove(options);
194 }
195 return result;
196 }
197
198 async setKeyExDate({fingerprint, keyringId, newExDateISOString}) {
199 const keyring = await keyringById(keyringId);

Callers

nothing calls this directly

Calls 5

getPrivateKeyByFprMethod · 0.80
uploadMethod · 0.80
toHexMethod · 0.80
getKeyIDMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected