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;
        }
Пример #2
0
 public void WriteApiKeyToSettingFile(string apiKey)
 {
     var settings = new UserSettings(new PhysicalFileSystem(Environment.CurrentDirectory));
     settings.SetEncryptedValue(ApiKeysSectionName, PublishPackageLocation, apiKey);
 }
Пример #3
0
 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);
 }