Beispiel #1
0
        public static Vault Load(FileInfo file, string vaultName, string password, out VaultDatabase vaultDb, ILogger logger = null)
        {
            string key = $"{file.FullName}.{vaultName}";

            lock (_loadedVaultsLock)
            {
                if (!_loadedVaults.ContainsKey(key))
                {
                    if (logger == null)
                    {
                        logger = Log.Default;
                    }
                    Database db = InitializeVaultDatabase(file.FullName, logger);
                    db.SelectStar = true;
                    _loadedVaults.Add(key, Retrieve(db, vaultName, password));
                }
            }
            vaultDb = _loadedVaults[key].Database;
            return(_loadedVaults[key]);
        }
Beispiel #2
0
 public static Vault Load(FileInfo file, string vaultName, out VaultDatabase vaultDb)
 {
     return(Load(file, vaultName, "".RandomLetters(16), out vaultDb)); // password will only be used if the file doesn't exist
 }
Beispiel #3
0
 public static Vault Load(string filePath, string vaultName, out VaultDatabase vaultDb)
 {
     return(Load(new FileInfo(filePath), vaultName, out vaultDb));
 }