nusign 1.0.1
dotnet tool install --global nusign --version 1.0.1
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local nusign --version 1.0.1
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=nusign&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package nusign --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuget-signing-certs
nuget-signing-certs provides:
- A .NET library for NuGet signing certificate generation/validation workflows.
- A CLI (
nusign) for signing and verifying already-packed NuGet artifacts (.nupkg+.snupkg).
Why this exists
nusign exists to make NuGet package signing reliable and explicit in real-world CI/CD environments.
- Raw signing flows often fail on transient TSA/network issues;
nusignprovides built-in fallback and retry behavior. - Teams need clear verification semantics;
nusignseparates strict trust verification from explicit dev/self-signed checks. - Signing, verifying, and dev cert workflows are easier to automate when exposed as one consistent CLI + library surface.
Why use nusign instead of raw dotnet nuget commands
- Built-in timestamp resilience: multi-URL fallback, retry, and timeout controls.
- Better diagnostics on timestamp failures: URL + attempt + concise reason before fallback.
- Simpler package targeting for CI: path discovery for
.nupkgand.snupkg. - Safer operator ergonomics: password via env var and redacted command display.
- Clear verification intent:
verifyfor strict trust-based validationverify-devfor explicit signature-presence checks in self-signed/dev workflows.
Library features
- Generate self-signed RSA code-signing certificates with secure defaults.
- Export and import PKCS#12 (
.pfx) certificate bundles. - Validate certificate profile readiness for NuGet signing requirements:
- RSA key algorithm and minimum key size.
- Key Usage (
digitalSignature). - Extended Key Usage containing
codeSigning(1.3.6.1.5.5.7.3.3). - Certificate validity window checks.
Library quick start
using Dexcompiler.NuGetSigningCertificates;
var cert = CodeSigningCertificateGenerator.CreateSelfSignedCertificate(
new CodeSigningCertificateRequest
{
SubjectName = "CN=My NuGet Signing Cert",
KeySizeInBits = 3072
});
var validation = NuGetSigningCertificateValidator.Validate(cert);
if (!validation.IsValid)
{
throw new InvalidOperationException(string.Join(Environment.NewLine, validation.Issues.Select(i => i.Message)));
}
byte[] pfx = Pkcs12CertificateStore.Export(cert, "strong-password");
CLI quick start (nusign)
Install as a .NET global tool:
dotnet tool install -g nusign
Then run directly from your shell:
nusign --help
Generate local/dev signing certificate PFX:
nusign generate-dev-cert \
--output-pfx ./artifacts/dev-signing.pfx \
--password "<strong-password>" \
--subject "CN=My NuGet Dev Signing Cert"
Sign packages from another already-packed project:
export NUGET_SIGN_CERT_PASSWORD=<strong-password>
nusign sign \
--input ../other-project/artifacts \
--pfx-path ./artifacts/dev-signing.pfx \
--timestamp-url https://rfc3161.ai.moda \
--timestamp-url https://rfc3161.ai.moda/any \
--timestamp-url http://timestamp.digicert.com \
--timestamp-timeout-seconds 15 \
--timestamp-retries 2 \
--timestamp-retry-delay-ms 500 \
--overwrite
Or provide fallback URLs from a file:
nusign sign \
--input ../other-project/artifacts \
--pfx-path ./artifacts/dev-signing.pfx \
--timestamp-url-file ./tsa-fallbacks.txt
Verify signatures:
nusign verify --input ../other-project/artifacts
Dev/self-signed signature presence checks (no trust-chain requirement):
nusign verify-dev --input ../other-project/artifacts
For machine-readable output in CI, add --json to sign, verify, verify-dev, or generate-dev-cert.
Recommended fallback TSA order
https://rfc3161.ai.modahttps://rfc3161.ai.moda/anyhttp://rfc3161.ai.modahttp://timestamp.digicert.comhttp://timestamp.globalsign.com/tsa/r6advanced1http://rfc3161timestamp.globalsign.com/advancedhttp://timestamp.sectigo.comhttp://time.certum.plhttp://timestamp.entrust.net/TSS/RFC3161sha2TShttp://timestamp.acs.microsoft.com
Verification behavior notes
verifyis release-safe and trust-based by default.verify-devis explicit dev behavior (signature presence check only).- Self-signed certificates can fail strict trust verification (
NU3018) by design. - Some HTTPS TSA endpoints may be blocked in specific runners/networks; fallback ordering is recommended.
Suggested flow for external package signing
- Generate or load a signing certificate (
.pfx). - Sign the target project output artifacts (
.nupkgand.snupkg) with CLIsign. - Run CLI
verifyto confirm signatures. - Publish signed packages.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.