private void VerifySigning(string nupkgPath) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { if (_firstPartyNuGetPackageSigningVerifier.IsExecutableIsFirstPartySignedWithoutValidation(new FilePath( typeof(DotNet.Cli.Program).Assembly.Location))) { if (!_firstPartyNuGetPackageSigningVerifier.Verify(new FilePath(nupkgPath), out string commandOutput)) { throw new NuGetPackageInstallerException(LocalizableStrings.FailedToValidatePackageSigning + Environment.NewLine + commandOutput); } } else { if (!_validationMessagesDisplayed) { _reporter.WriteLine( LocalizableStrings.SkipNuGetpackageSigningValidationSDKNotFirstParty); _validationMessagesDisplayed = true; } } } else { if (!_validationMessagesDisplayed) { _reporter.WriteLine( LocalizableStrings.SkipNuGetpackageSigningValidationmacOSLinux); _validationMessagesDisplayed = true; } } }
private void VerifySigning(string nupkgPath) { if (!_verifySignatures) { if (!_validationMessagesDisplayed) { _reporter.WriteLine( LocalizableStrings.NuGetPackageSignatureVerificationSkipped); _validationMessagesDisplayed = true; } return; } if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { if (!_firstPartyNuGetPackageSigningVerifier.Verify(new FilePath(nupkgPath), out string commandOutput)) { throw new NuGetPackageInstallerException(LocalizableStrings.FailedToValidatePackageSigning + Environment.NewLine + commandOutput); } } }