MCPcopy Create free account
hub / github.com/QuantiaAI/helm-agents / constructor

Method constructor

apps/api/src/lib/key-cipher.ts:13–22  ·  view source on GitHub ↗
(storeDir: string)

Source from the content-addressed store, hash-verified

11 private key: Buffer;
12
13 constructor(storeDir: string) {
14 mkdirSync(storeDir, { recursive: true });
15 const p = join(storeDir, "master.key");
16 if (existsSync(p)) {
17 this.key = Buffer.from(readFileSync(p, "utf8").trim(), "base64");
18 } else {
19 this.key = randomBytes(32);
20 writeFileSync(p, this.key.toString("base64"), { mode: 0o600 });
21 }
22 }
23
24 encrypt(plaintext: string): string {
25 const iv = randomBytes(12);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected