| 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 => { |