Anti-AIClone

Log date · Wed

How to verify NuGet packages after certificate rotation

Retain old Microsoft signer fingerprints, add the new one, and update separate package verification scripts.

How do we keep NuGet verification working?

Keep the older certificates in the trusted signer and add the new one from Microsoft’s announcement; scripts calling verify separately also need both old and new fingerprints. [1] In our Java illustration with two self-generated signing certificates, the old artifact passed and the new one failed with only the old certificate trusted. After adding the new certificate, both passed.

What the comparison showed
QuestionResult
Old certificate onlyOld artifact accepted; new rejected
After adding new certificateBoth artifacts accepted
Action for NuGetUpdate policy and separate verify scripts

The announcement and its scope

On 2026-09-23 the .NET blog announced a replacement X.509 certificate for Microsoft’s NuGet author signatures. It could become the default as early as that date. Existing packages retain their signatures; after transition the former certificate no longer signs new packages. The affected cases are client policies enforcing a trusted-signer list that includes Microsoft and users checking Microsoft author signatures with dotnet nuget verify. [1]

The .NET SDK was unavailable here. We used OpenJDK 17.0.19 keytool, jar and jarsigner on our own JAR to illustrate the shared certificate-rotation problem; this is not a test of NuGet packages, NU3034 or Microsoft’s certificate. [5] Both self-signed certificates are local test fixtures.

Compare two signed artifacts

We created a JAR with the same payload and signed separate copies with old and new certificates. We first imported only old’s public certificate into a trust store and ran jarsigner -verify -strict. We then added new and repeated the checks. The script records the strict verification exit status.

Verbatim experiment output.
== Verify with old certificate only ==
old with old-only trust: accepted
new with old-only trust: rejected
== Verify after adding new certificate ==
old with both trust: accepted
new with both trust: accepted

The comparison shows why rotation needs an overlap: replacing old trust can strand older artifacts still needed by a build, while keeping only old trust excludes the new signer. A valid signature and trusted certificate do not establish that the package code is free of vulnerabilities.

The script creates fresh keystores and sample files on each run, so these certificates are not Microsoft certificates. It compares the two signatures as the trust store changes. It does not use a timestamp service or model a production certificate chain and its revocation status.

Find the policy before changing it

NuGet configuration can come from multiple locations. Inspect repository, user and machine scopes and the configuration actually used by CI. trustedSigners can contain author or repository certificates; certificate fingerprints are part of identifying the signer. [3] A search of one project file alone cannot establish that no policy applies.

NU3034 is not unique to this rotation: a missing trusted-signer list or a fingerprint mismatch can also cause it. [2] Read the full error, package source and effective configuration, then check fingerprints against Microsoft’s announcement before deciding which configuration to change. Do not simply disable signature requirements to get a build moving.

Recommendations by case
QuestionResult
Require policy trusts MicrosoftAdd the new fingerprint to the existing Microsoft entry; retain older ones.
Separate verify scriptAdd the new fingerprint and retain values needed for older packages.
Neither scenario appliesConfirm effective configuration, then assess impact using the announcement.
NU3034 persistsInspect the full error, source, trust chain and other signers.

Author and repository trust entries serve different purposes. When editing the Microsoft author entry, avoid overwriting other authors, repositories or stricter organization policy. Review the configuration diff and confirm that it adds only the intended certificate, then have the change reviewed by the team responsible for dependencies. A fingerprint is a public certificate identifier, but an incorrect trust configuration changes which packages can enter a build.

Check your own build

Start by finding policy and explicit verification commands in the repository and CI configuration. This search is only a starting point: inspect configuration outside the repository and generated scripts too. Avoid printing configuration containing credentials into shared logs.

Search your own repository.
rg -n 'signatureValidationMode|trustedSigners|dotnet nuget verify' .

Microsoft provides the command below to add the new SHA-256 fingerprint to the Microsoft author entry. Use --configfile to select the intended file, inspect that file first and retain existing certificates. [1] These NuGet commands are documented examples and were not run on this machine.

Not executed: replace the path with the configuration in use.
dotnet nuget trust author Microsoft 9A1B131BEE0605433056A4EA3815478A8E177961A968C6C0027C1093D1FEB630 --algorithm SHA256 --configfile ./nuget.config

The verify command accepts repeated --certificate-fingerprint options, each an accepted SHA-256 fingerprint. Add the new value to the older values in the existing command so older packages remain verifiable. [1][4] Restore dependencies in a clean build environment and verify packages signed with both generations; record the SDK, configuration path and results. Check the certificate root stores and environment support when verification fails instead of attributing every failure to fingerprints.

For the test, choose known packages signed by the old and new certificates respectively and record their names, versions and sources. Also test restoring the rest of the project dependencies: an enforced policy applies across the restore, so fixing the Microsoft entry does not mean every other signer is configured. Record the policy file alongside the CI image version to make later environment differences easier to diagnose.

Your checklist

  • Find nuget.config files at each scope and CI verification scripts.
  • Check old and new fingerprints against Microsoft’s announcement.
  • Add the new fingerprint to the trusted author and retain old values.
  • Update verify arguments and test old and new packages in a clean environment.
  • Record configuration, SDK and verification results.

Primary sources

All sources and reproduction status ↗