dotnet-nuget-trust(1)

๐Ÿ“ฆ
version 11.0.0~rc3 ยท 6 versions
, in alpine 3.24, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– dotnet-nuget-trust(1) โ€” the .NET Documentation glow-up ๐Ÿ’–

okay bestie, welcome to dotnet-nuget-trust, page one of the whole saga. this is a .NET Documentation moment, and it applies to: โœ”๏ธ .NET 6 SDK and later versions. yes queen, we're in the modern era. โœจ


โœจ NAME โœจ

dotnet-nuget-trust โ€” literally just gets or sets trusted signers to the NuGet configuration. that's the whole vibe. ๐ŸŽ€


๐ŸŒธ SYNOPSIS ๐ŸŒธ

dotnet nuget trust [command] [Options]

dotnet nuget trust -h|--help

like, you call the thing, you give it a command, you give it options. help is always there for you. ๐Ÿซถ


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so the dotnet nuget trust command is the one managing the trusted signers, mmkay? by default, NuGet is out here accepting all authors and repositories. no thoughts, head empty, trusting everyone. ๐Ÿ˜ญ

these commands let you be picky โ€” you specify only a specific subset of signers whose signatures will be accepted, and reject literally everyone else. main character energy only. ๐Ÿ‘‘

for more information, see Common NuGet configurations. and for the deets on what the nuget.config schema looks like, refer to the NuGet config file reference.

โš ๏ธ heads up bestie: this command requires a certificate root store that is valid for both code signing and timestamping. also, this command may not be supported on some combinations of operating system and .NET SDK. for more information, see NuGet signed package verification. don't come for me, that's just what the docs said. ๐Ÿ’€

๐Ÿ’… OPTIONS ๐Ÿ’…

  • -? | -h | --help โ€” prints out a description of how to use the command. the classic "help me bestie" button. ๐Ÿ™ˆ

๐ŸŽ€ Commands ๐ŸŽ€

if no command is specified, the command will default to list. it said "not me choosing for you" and honestly? valid. โœจ


๐ŸŒˆ list

lists all the trusted signers in the configuration. this option will include all the certificates (with fingerprint and fingerprint algorithm) each signer has. and if a certificate has a preceding [U], it means that certificate entry has allowUntrustedRoot set as true. iykyk. ๐Ÿ’–

Synopsis:

dotnet nuget trust list [--configfile <PATH>] [-h|--help] [-v, --verbosity <LEVEL>]

Options:

  • --configfile <FILE> โ€” the NuGet configuration file (nuget.config) to use. if specified, only the settings from this file will be used. if not specified, the hierarchy of configuration files from the current directory will be used. for more information, see Common NuGet Configurations. it's giving "choose your own adventure" but for configs. ๐Ÿ—‚๏ธ
  • -? | -h | --help โ€” prints out a description of how to use the command.
  • -v | --verbosity <LEVEL> โ€” sets the verbosity level of the command. allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. the default is minimal. for more information, see xref:Microsoft.Build.Framework.LoggerVerbosity. lowkey the most-used flag in existence fr fr.

๐Ÿงš sync

deletes the current list of certificates and replaces them with an up-to-date list from the repository. out with the old, in with the fresh. slay. ๐Ÿ”ฅ

Synopsis:

dotnet nuget trust sync <NAME> [--configfile <PATH>] [-h|--help] [-v, --verbosity <LEVEL>]

Arguments:

  • NAME โ€” the name of the existing trusted signer to sync.

Options:

  • --configfile <FILE> โ€” the NuGet configuration file (nuget.config) to use. if specified, only the settings from this file will be used. if not specified, the hierarchy of configuration files from the current directory will be used. for more information, see Common NuGet Configurations.
  • -? | -h | --help โ€” prints out a description of how to use the command.
  • -v | --verbosity <LEVEL> โ€” sets the verbosity level of the command. allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. the default is minimal. for more information, see xref:Microsoft.Build.Framework.LoggerVerbosity.

๐Ÿ’€ remove

removes any trusted signers that match the given name. it's the block button but for signers. not me being dramatic, it literally says that. ๐Ÿ™ˆ

Synopsis:

dotnet nuget trust remove <NAME> [--configfile <PATH>] [-h|--help] [-v, --verbosity <LEVEL>]

Arguments:

  • NAME โ€” the name of the existing trusted signer to remove.

Options:

  • --configfile <FILE> โ€” the NuGet configuration file (nuget.config) to use. if specified, only the settings from this file will be used. if not specified, the hierarchy of configuration files from the current directory will be used. for more information, see Common NuGet Configurations.
  • -? | -h | --help โ€” prints out a description of how to use the command.
  • -v | --verbosity <LEVEL> โ€” sets the verbosity level of the command. allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. the default is minimal. for more information, see xref:Microsoft.Build.Framework.LoggerVerbosity.

๐ŸŒŸ author

adds a trusted signer with the given name, based on the author signature of the package. respecting the author's whole artistry. ๐ŸŽจ

Synopsis:

dotnet nuget trust author <NAME> <PACKAGE> [--allow-untrusted-root] [--configfile <PATH>] [-h|--help] [-v, --verbosity <LEVEL>]

Arguments:

  • NAME โ€” the name of the trusted signer to add. if NAME already exists in the configuration, the signature is appended. no overwriting, just stacking. ๐Ÿ’…
  • PACKAGE โ€” the given PACKAGE should be a local path to the signed .nupkg file.

Options:

  • --allow-untrusted-root โ€” specifies if the certificate for the trusted signer should be allowed to chain to an untrusted root. this is not recommended. like, genuinely not recommended. don't do it. ๐Ÿšฉ
  • --configfile <FILE> โ€” the NuGet configuration file (nuget.config) to use. if specified, only the settings from this file will be used. if not specified, the hierarchy of configuration files from the current directory will be used. for more information, see Common NuGet Configurations.
  • -? | -h | --help โ€” prints out a description of how to use the command.
  • -v | --verbosity <LEVEL> โ€” sets the verbosity level of the command. allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. the default is minimal. for more information, see xref:Microsoft.Build.Framework.LoggerVerbosity.

๐Ÿ’œ repository

adds a trusted signer with the given name, based on the repository signature or countersignature of a signed package. repository girlies rise up. ๐Ÿซถ

Synopsis:

dotnet nuget trust repository <NAME> <PACKAGE> [--allow-untrusted-root] [--configfile <PATH>] [-h|--help] [--owners <LIST>] [-v, --verbosity <LEVEL>]

Arguments:

  • NAME โ€” the name of the trusted signer to add. if NAME already exists in the configuration, the signature is appended.
  • PACKAGE โ€” the given PACKAGE should be a local path to the signed .nupkg file.

Options:

  • --allow-untrusted-root โ€” specifies if the certificate for the trusted signer should be allowed to chain to an untrusted root. this is not recommended. fr, they said it, not me. ๐Ÿ˜ญ
  • --configfile <FILE> โ€” the NuGet configuration file (nuget.config) to use. if specified, only the settings from this file will be used. if not specified, the hierarchy of configuration files from the current directory will be used. for more information, see Common NuGet Configurations.
  • -? | -h | --help โ€” prints out a description of how to use the command.
  • --owners <LIST> โ€” semicolon-separated list of trusted owners to further restrict the trust of a repository. yes, LIST. yes, semicolons. no, not commas. โœจ
  • -v | --verbosity <LEVEL> โ€” sets the verbosity level of the command. allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. the default is minimal. for more information, see xref:Microsoft.Build.Framework.LoggerVerbosity.

๐ŸŽ€ certificate

adds a trusted signer with the given name, based on a certificate fingerprint. very specific, very secure, very cunt. ๐Ÿ’…

Synopsis:

dotnet nuget trust certificate <NAME> <FINGERPRINT> [--algorithm <ALGORITHM>] [--allow-untrusted-root] [--configfile <PATH>] [-h|--help] [-v, --verbosity <LEVEL>]

Arguments:

  • NAME โ€” the name of the trusted signer to add. if a trusted signer with the given name already exists, the certificate item is added to that signer. otherwise a trusted author is created with a certificate item from the given certificate information. either way, you're getting a signer. ๐Ÿ‘‘
  • FINGERPRINT โ€” the fingerprint of the certificate.

Options:

  • --algorithm <ALGORITHM> โ€” specifies the hash algorithm used to calculate the certificate fingerprint. defaults to SHA256. values supported are SHA256, SHA384 and SHA512. pick your fighter. โญ
  • --allow-untrusted-root โ€” specifies if the certificate for the trusted signer should be allowed to chain to an untrusted root. this is not recommended. okay but why does this option keep showing up. it keeps showing up because it's real and you should still avoid it. ๐Ÿšฉ
  • --configfile <FILE> โ€” the NuGet configuration file (nuget.config) to use. if specified, only the settings from this file will be used. if not specified, the hierarchy of configuration files from the current directory will be used. for more information, see Common NuGet Configurations.
  • -? | -h | --help โ€” prints out a description of how to use the command.
  • -v | --verbosity <LEVEL> โ€” sets the verbosity level of the command. allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. the default is minimal. for more information, see xref:Microsoft.Build.Framework.LoggerVerbosity.

๐Ÿ“ source

adds a trusted signer based on a given package source. sourcing the tea, respectfully. โ˜•

Synopsis:

dotnet nuget trust source <NAME> [--configfile <PATH>] [-h|--help] [--owners <LIST>] [--source-url] [-v, --verbosity <LEVEL>]

Arguments:

  • NAME โ€” the name of the trusted signer to add. if only <NAME> is provided without --<source-url>, the package source from your NuGet configuration files with the same name is added to the trusted list. if <NAME> already exists in the configuration, the package source is appended to it. it's giving "it knows what you mean". ๐Ÿ”ฎ

Options:

  • --configfile <FILE> โ€” the NuGet configuration file (nuget.config) to use. if specified, only the settings from this file will be used. if not specified, the hierarchy of configuration files from the current directory will be used. for more information, see Common NuGet Configurations.
  • -? | -h | --help โ€” prints out a description of how to use the command.
  • --owners <LIST> โ€” semicolon-separated list of trusted owners to further restrict the trust of a repository.
  • --source-url โ€” if a source-url is provided, it must be a v3 package source URL (like https://api.nuget.org/v3/index.json). other package source types are not supported. v3 or nothing, bestie. ๐Ÿฆ‹
  • -v | --verbosity <LEVEL> โ€” sets the verbosity level of the command. allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. the default is minimal. for more information, see xref:Microsoft.Build.Framework.LoggerVerbosity.

okay that's part 1, and there's more coming so don't go anywhere ๐Ÿ’–โœจ

โœจ EXAMPLES โœจ

Okay bestie, this is the part where it all clicks. Real commands, real vibes, copy-paste energy. Let's go ๐Ÿ’…


๐ŸŒธ Peek at who you already trust

Want the full roster of trusted signers? Just:

dotnet nuget trust list

No flags, no drama. It's giving "let me see the guest list" ๐Ÿ“‹โœจ


๐ŸŒˆ Trust a whole source, but in that config file

Say you wanna trust the source NuGet, but only inside a specific nuget.config (not the default one, we're being โœจspecificโœจ):

dotnet nuget trust source NuGet --configfile ..\nuget.config

The --configfile points at ..\nuget.config, so this trust lives there and nowhere else. Lowkey iconic behavior tbh ๐Ÿซถ


๐ŸŽ€ Trust an author straight from a package

Got a signed nupkg file and you wanna vouch for whoever made it? Slide in with the author subcommand:

dotnet nuget trust author PackageAuthor .\foo.nupkg

Here PackageAuthor is the name you're giving that trusted author, and .\foo.nupkg is the signed package file you're pulling them from. Two args, one trust, zero regrets ๐ŸŒŸ


๐Ÿฆ‹ Trust a repository from a package file

Same energy, but for a repo instead of a human:

dotnet nuget trust repository PackageRepository .\foo.nupkg

PackageRepository = the name you're assigning, .\foo.nupkg = the signed package it comes from. Chef's kiss ๐Ÿ‘‘


๐Ÿ”ฅ Trust a certificate by its SHA256 fingerprint

This one's the fancy one, ngl. You're trusting a package signing certificate using its fingerprint:

dotnet nuget trust certificate MyCert  F99EC8CDCE5642B380296A19E22FA8EB3AEF1C70079541A2B3D6E4A93F5E1AFD --algorithm SHA256

Let's break the vibe check down:

  • MyCert โ€” the name you're giving this trusted certificate.
  • F99EC8CDCE5642B380296A19E22FA8EB3AEF1C70079541A2B3D6E4A93F5E1AFD โ€” the actual SHA256 fingerprint, no cap.
  • --algorithm SHA256 โ€” telling it which algorithm that fingerprint belongs to.
Heads up bestie: that fingerprint has to be exactly right. One wrong character and it's over ๐Ÿ’€

๐Ÿ’œ Trust some owners from a source URL

You can trust specific owners from a repository too. Like, say, Nuget and Microsoft from https://api.nuget.org/v3/index.json:

dotnet nuget trust source NuGetTrust --source-url https://api.nuget.org/v3/index.json --owners "Nuget;Microsoft"
  • NuGetTrust โ€” the name for this trusted source.
  • --source-url https://api.nuget.org/v3/index.json โ€” where the repo lives.
  • --owners "Nuget;Microsoft" โ€” the owners you're trusting. Note the ; separating them inside the quotes โ€” that's the separator, bestie, don't @ me.

Multiple owners, one command. Efficiency queen behavior fr fr ๐Ÿ‘ธ


๐Ÿงš Remove a trusted signer (goodbye era)

When someone's gotta go, they gotta go. Here's how you remove the trusted signer named NuGet from a specific config file:

dotnet nuget trust remove NuGet --configfile ..\nuget.config

remove + the signer name + --configfile ..\nuget.config and poof, they're out of that file. Unbothered, uninvited, slayed ๐ŸŽ€


And that's the whole page, bestie! ๐ŸŒˆ This lil' slice of manpage magic came from the dotnet-nuget-trust(1) manual, dated 2025-10-30 โ€” go forth and trust responsibly, mwah ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from