Changeset 7663


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

#1680: encrypt/decrypt azure subscription data

Location:
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3
Files:
1 added
2 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);
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/HeuristicLab.Clients.Hive.CloudManager-3.3.csproj

    r7655 r7663  
    4545    <Reference Include="System.Core" />
    4646    <Reference Include="System.Drawing" />
     47    <Reference Include="System.Security" />
    4748    <Reference Include="System.Windows.Forms" />
    4849    <Reference Include="System.Windows.Forms.DataVisualization" />
     
    6263    <Compile Include="Azure\Utils.cs" />
    6364    <Compile Include="CloudManagerClient.cs" />
     65    <Compile Include="CryptoService.cs" />
    6466    <Compile Include="MenuItems\CloudManagerMenuItem.cs" />
    6567    <Compile Include="Model\AffinityGroup.cs" />
Note: See TracChangeset for help on using the changeset viewer.