MCPcopy
hub / github.com/mailvelope/mailvelope / logEncryption

Function logEncryption

src/modules/pgpModel.js:209–219  ·  view source on GitHub ↗

* Log encryption operation * @param {String} source - source that triggered encryption operation * @param {KeyringBase} keyring * @param {Array } keyFprs - fingerprint of used keys

(source, keyring, keyFprs)

Source from the content-addressed store, hash-verified

207 * @param {Array<String>} keyFprs - fingerprint of used keys
208 */
209async function logEncryption(source, keyring, keyFprs) {
210 if (source) {
211 const keys = keyring.getKeysByFprs(keyFprs);
212 const recipients = await Promise.all(keys.map(async key => {
213 const {userId} = await getUserInfo(key, {allowInvalid: true});
214 return userId;
215 }));
216 uiLog.push(source, 'security_log_encryption_operation', [recipients.join(', ')], false);
217 recordOnboardingStep(COMMUNICATION, 'Encryption');
218 }
219}
220
221/**
222 * Log decryption operation

Callers 2

encryptMessageFunction · 0.85
encryptFileFunction · 0.85

Calls 4

getUserInfoFunction · 0.90
recordOnboardingStepFunction · 0.90
getKeysByFprsMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected