MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / encryptMessage

Function encryptMessage

src/app/encrypt/Encrypt.js:154–170  ·  view source on GitHub ↗
(message, recipients)

Source from the content-addressed store, hash-verified

152 }
153
154 async encryptMessage(message, recipients) {
155 try {
156 const encrypted = await port.send('encrypt-message', {
157 data: message,
158 keyringId: this.state.keyringId,
159 encryptionKeyFprs: recipients.map(r => r.fingerprint),
160 signingKeyFpr: this.state.signingKey ? this.state.signingKey.fingerprint : '',
161 uiLogSource: 'security_log_encrypt_ui',
162 noCache: false,
163 armor: true,
164 allKeyrings: true
165 });
166 this.setState(prevState => ({encrypted: [...prevState.encrypted, this.createFileObject({content: encrypted, filename: 'text.txt', mimeType: 'text/plain'})]}));
167 } catch (error) {
168 this.setErrorNotification(error);
169 }
170 }
171
172 encryptFiles(plainFiles, recipients) {
173 return Promise.all(plainFiles.map(async plainFile => {

Callers

nothing calls this directly

Calls 2

sendMethod · 0.45
setStateMethod · 0.45

Tested by

no test coverage detected