namespace JdeScoping.SecureStoreManager.Services; /// /// Interface for managing SecureStore encrypted secret stores. /// public interface ISecureStoreManager { /// /// Gets whether a store is currently open. /// bool IsStoreOpen { get; } /// /// Gets the path to the currently open store, or null if no store is open. /// string? CurrentStorePath { get; } /// /// Gets whether there are unsaved changes to the current store. /// bool HasUnsavedChanges { get; } /// /// Creates a new store secured with a key file. /// /// Path for the new store file (.json). /// Path for the key file (.key). void CreateStore(string storePath, string keyFilePath); /// /// Opens an existing store using a key file. /// /// Path to the store file (.json). /// Path to the key file (.key). void OpenStore(string storePath, string keyFilePath); /// /// Closes the currently open store without saving. /// void CloseStore(); /// /// Saves changes to the currently open store. /// void Save(); /// /// Gets all secret keys in the current store. /// /// Collection of secret key names. IReadOnlyList GetKeys(); /// /// Gets the value of a secret. /// /// The secret key. /// The decrypted secret value. string GetSecret(string key); /// /// Sets or updates a secret value. /// /// The secret key. /// The value to encrypt and store. void SetSecret(string key, string value); /// /// Removes a secret from the store. /// /// The secret key to remove. void RemoveSecret(string key); /// /// Generates a new key file for use with store encryption. /// /// Path where the key file will be created. void GenerateKeyFile(string path); /// /// Exports the current store's key to a file (for key file-based stores). /// /// Path where the key will be exported. void ExportKey(string path); }