(filepath: string, contents: string)
| 86 | } |
| 87 | |
| 88 | async writeProtectedFile(filepath: string, contents: string) { |
| 89 | assertNotTouchingFiles(filepath, 'write'); |
| 90 | if (!encryptionKey) { |
| 91 | encryptionKey = await UI.getWindowsEncryptionPassword(); |
| 92 | } |
| 93 | let encryptedContents = this.encrypt(contents, encryptionKey); |
| 94 | write(filepath, encryptedContents); |
| 95 | } |
| 96 | |
| 97 | private encrypt(text: string, key: string) { |
| 98 | let cipher = crypto.createCipher('aes256', new Buffer(key)); |
nothing calls this directly
no test coverage detected