Exemplo n.º 1
0
 public EncryptedConfig(bool autoLoadKey)
 {
     this.keyedValues = new Dictionary <string, string>();
     this.KeyFile     = new KeyVectorPair();
     if (PasswordFile.Exists && autoLoadKey)
     {
         this.KeyFile = KeyVectorPair.Load(PasswordFile.FullName);
     }
 }
Exemplo n.º 2
0
        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);
        }