node-json-db
Version:
Database using JSON file as storage for Node.JS
21 lines (20 loc) • 545 B
TypeScript
import { FileAdapter } from "./FileAdapter";
import { CipherKey } from 'crypto';
interface CipheredData {
iv: string;
tag: string;
data: string;
}
export declare class CipheredFileAdapter extends FileAdapter {
private key;
constructor(key: CipherKey, filename: string, fsync: boolean);
decrypt(data: CipheredData): string;
readAsync(): Promise<string | null>;
encrypt(data: string): {
iv: string;
tag: string;
data: string;
};
writeAsync(data: string): Promise<void>;
}
export {};