| 191 | } |
| 192 | |
| 193 | createFileObject({content, filename, mimeType}) { |
| 194 | // set MIME type fix to application/octet-stream as other types can be exploited in Chrome |
| 195 | mimeType = 'application/octet-stream'; |
| 196 | const file = {id: getUUID()}; |
| 197 | if (fileLib.extractFileExtension(filename) === 'txt') { |
| 198 | file.name = `${filename}.asc`; |
| 199 | file.content = content; |
| 200 | } else { |
| 201 | file.name = `${filename}.gpg`; |
| 202 | } |
| 203 | const blob = new Blob([str2ab(content)], {type: mimeType}); |
| 204 | file.objectURL = window.URL.createObjectURL(blob); |
| 205 | return file; |
| 206 | } |
| 207 | |
| 208 | async handleChangeSigningKey() { |
| 209 | const signingKeys = await port.send('get-signing-keys', {keyringId: this.state.keyringId}); |