MCPcopy Create free account
hub / github.com/davewasmer/devcert / writeProtectedFile

Method writeProtectedFile

src/platforms/win32.ts:88–95  ·  view source on GitHub ↗
(filepath: string, contents: string)

Source from the content-addressed store, hash-verified

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));

Callers

nothing calls this directly

Calls 3

encryptMethod · 0.95
assertNotTouchingFilesFunction · 0.90

Tested by

no test coverage detected