Rebuild AgentCompany Electron app
This commit is contained in:
1 parent
bc5daa6eb8
commit
fcf6d90731
56 files changed
+8667
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { safeStorage } from "electron";
|
||||
|
||||
export class SecretVault {
|
||||
encryptSecret(secret: string): Buffer {
|
||||
if (!safeStorage.isEncryptionAvailable()) {
|
||||
throw new Error("OS credential encryption is unavailable.");
|
||||
}
|
||||
return safeStorage.encryptString(secret);
|
||||
}
|
||||
|
||||
decryptSecret(ciphertext: Buffer): string {
|
||||
if (!safeStorage.isEncryptionAvailable()) {
|
||||
throw new Error("OS credential encryption is unavailable.");
|
||||
}
|
||||
return safeStorage.decryptString(ciphertext);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user