/// <summary>
        ///     Returns a <see cref="T:System.IO.Stream" /> that contains the adapted output.
        /// </summary>
        /// <param name="packageInfo">Information about the package to adapt.</param>
        /// <returns>
        ///     <see cref="T:System.IO.Stream" /> that contains the adapted output.
        /// </returns>
        public sealed override Stream Adapt(PackageAdapterContext packageInfo)
        {
            if (this.IsFeedSupported(packageInfo.Feed))
            {
                var packageSigner = this.CreatePackageSigner(packageInfo);
                var packageStream = packageInfo.GetPackageStream(takeOwnership: false);
                packageSigner.TrySignPackage(ref packageStream);
                return(packageStream);
            }

            Logger.Warning($"Skipping sign before download as the [{packageInfo.Feed.FeedName}|{packageInfo.Feed.FeedType}] is not supported by this signer [{this.GetType( ).Name}].");
            return(packageInfo.GetPackageStream(takeOwnership: false));
        }
Exemplo n.º 2
0
 /// <summary>   Creates the package signer. </summary>
 /// <param name="packageInfo">  Information about the package to sign.</param>
 /// <returns>   The new package signer. </returns>
 protected internal override IPackageSigner CreatePackageSigner(PackageAdapterContext packageInfo)
 {
     return(new NuGetPackageSigner(packageInfo.Feed.FeedName, this.DefaultKeyName, this.AdditionalKeyPaths));
 }
 /// <summary>   Creates the package signer. </summary>
 /// <param name="packageInfo">  Information about the package to sign.</param>
 /// <returns>   The new package signer. </returns>
 protected internal abstract IPackageSigner CreatePackageSigner(PackageAdapterContext packageInfo);