public string ReadApiKey(string source) { var settings = new UserSettings(new PhysicalFileSystem(Environment.CurrentDirectory)); string key = settings.GetDecryptedValue(ApiKeysSectionName, source); if (String.IsNullOrEmpty(key)) { if (IsFirstTimeAfterUpdate && source.Equals(NuGetConstants.V2LegacyFeedUrl, StringComparison.OrdinalIgnoreCase)) { key = Settings.Default.PublishPrivateKey; } } return key; }
public void WriteApiKeyToSettingFile(string apiKey) { var settings = new UserSettings(new PhysicalFileSystem(Environment.CurrentDirectory)); settings.SetEncryptedValue(ApiKeysSectionName, PublishPackageLocation, apiKey); }
public string ReadApiKeyFromSettingFile() { var settings = new UserSettings(new PhysicalFileSystem(Environment.CurrentDirectory)); string key = settings.GetDecryptedValue(ApiKeysSectionName, PublishPackageLocation); return key ?? Properties.Settings.Default.PublishPrivateKey; }
public void WriteApiKey(string source, string apiKey) { var settings = new UserSettings(new PhysicalFileSystem(Environment.CurrentDirectory)); settings.SetEncryptedValue(ApiKeysSectionName, source, apiKey); }