Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/26/12 20:59:47 (13 years ago)
Author:
spimming
Message:

#1680: encrypt/decrypt azure subscription data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/CloudManagerClient.cs

    r7655 r7663  
    214214
    215215    public void PersistSubscriptionsToUserConfig() {
    216       StringCollection strCol = new StringCollection();
     216      Settings.Default.Upgrade();
     217      StringCollection strCol = Settings.Default.AzureSubscriptions;
     218      strCol.Clear();
    217219      foreach (Subscription sub in Subscriptions) {
    218220        if (sub.SaveToConfig) {
    219221          string setting = sub.GetSettingString();
    220           Settings.Default.AzureSubscriptions.Add(setting);
    221         }
    222       }
    223       //TODO:
    224       //Settings.Default.Upgrade();
    225       //Settings.Default.Save();
    226 
     222          setting = CryptoService.EncryptString(CryptoService.ToSecureString(setting));
     223          strCol.Add(setting);
     224        }
     225      }
     226      Settings.Default.Save();
    227227    }
    228228
     
    230230      StringCollection strCol = new StringCollection();
    231231      foreach (string azureSub in strCol) {
    232         Subscription s = Subscription.ParseSettingString(azureSub);
     232        string setting = CryptoService.ToInsecureString(CryptoService.DecryptString(azureSub));
     233        Subscription s = Subscription.ParseSettingString(setting);
    233234        s.SaveToConfig = true;
    234235        Add(s);
Note: See TracChangeset for help on using the changeset viewer.