public EncryptedConfig(bool autoLoadKey) { this.keyedValues = new Dictionary <string, string>(); this.KeyFile = new KeyVectorPair(); if (PasswordFile.Exists && autoLoadKey) { this.KeyFile = KeyVectorPair.Load(PasswordFile.FullName); } }
public void Save() { FileInfo file = ConfigFile;//new FileInfo(FsUtil.GetCurrentUserAppDataFolder() + typeof(EncryptedConfig).Name); if (file.Exists) { file.Delete(); } KeyVectorPair key = RijndaelEncryptor.Encrypt(this, file.FullName, PasswordFile.FullName); }