/** * Cross-platform key storage abstraction. * * Provides a unified interface for storing the Aegis master key in * OS-managed credential stores, keeping it out of plaintext files. * * Resolution order (auto-detect): * macOS → Keychain (`security` CLI) * Windows → Credential Manager (`cmdkey` + PowerShell) * Linux → Secret Service (`secret-tool` / libsecret) * Fallback → File (.aegis/.master-key, mode 0600) */ /** Backend identifier for display and diagnostics. */ export type KeyStorageBackend = 'macos-keychain' | 'windows-credential-manager' | 'linux-secret-service' | 'file'; /** Abstract key storage interface. All methods are synchronous to keep config loading simple. */ export interface KeyStorage { /** Human-readable backend name (e.g. "macOS Keychain"). */ readonly name: string; /** Machine-readable backend identifier. */ readonly backend: KeyStorageBackend; /** Check whether this backend is available on the current system. */ isAvailable(): boolean; /** Retrieve the master key. Returns undefined if not stored. */ getKey(): string | undefined; /** Store the master key (creates or replaces). */ setKey(key: string): void; /** Delete the stored master key. No-op if not present. */ deleteKey(): void; } /** Check whether a CLI tool exists on PATH. Results are cached per process. */ export declare function commandExists(command: string): boolean; /** Clear the commandExists cache (for testing). */ export declare function clearCommandExistsCache(): void; /** * Auto-detect the best available key storage backend for the current platform. * * @param dataDir Path to the .aegis data directory (used by file fallback). * @returns A KeyStorage implementation. */ export declare function getKeyStorage(dataDir: string): KeyStorage; //# sourceMappingURL=key-storage.d.ts.map