NuGet.CommandLineUtility.GetApiKey C# (CSharp) Method

GetApiKey() public static method

public static GetApiKey ( ISettings settings, string source, bool throwIfNotFound = true ) : string
settings ISettings
source string
throwIfNotFound bool
return string
        public static string GetApiKey(ISettings settings, string source, bool throwIfNotFound = true)
        {
            var value = settings.GetDecryptedValue(CommandLineUtility.ApiKeysSectionName, source);
            if (String.IsNullOrEmpty(value) && throwIfNotFound)
            {
                throw new CommandLineException(NuGetResources.NoApiKeyFound, GetSourceDisplayName(source));
            }
            return value;
        }