Skip to content

Support portable NuGet signing with Artifact Signing#11

Merged
Marc-André Moreau (mamoreau-devolutions) merged 5 commits into
masterfrom
mamoreau-devolutions/nuget-signing-pr
May 24, 2026
Merged

Support portable NuGet signing with Artifact Signing#11
Marc-André Moreau (mamoreau-devolutions) merged 5 commits into
masterfrom
mamoreau-devolutions/nuget-signing-pr

Conversation

@mamoreau-devolutions
Copy link
Copy Markdown
Contributor

Summary

This imports the useful work from #10 and cleans it up for a reviewable implementation of portable/Linux NuGet package signing with Azure Artifact Signing.

  • parses Artifact Signing signingCertificate payloads as DER, PEM, nested base64, or PKCS#7 certificate bundles, selecting the actual signer instead of relying on certificate order
  • produces NuGet-compatible .signature.p7s CMS with attached id-data, NuGet author attributes, and PKCS#9 RFC3161 timestamp attributes while preserving Authenticode timestamp behavior for companion signatures
  • normalizes NuGet ZIP central-directory metadata so Unix-created packages do not carry host/external attributes that NuGet rejects
  • expands deterministic tests for certificate parsing, ZIP normalization, local/package signing, timestamp OID behavior, and Artifact Signing/server-backed flows

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo test --workspace --locked --quiet

Enable portable Artifact Signing responses to be consumed on Linux by accepting PEM/DER/base64/PKCS#7 signingCertificate payloads and selecting the actual signing cert from PKCS#7 signer info or an unambiguous leaf certificate bag.

Make NuGet package signing produce verifiable packages by normalizing ZIP metadata, embedding CMS id-data content, and using the standard id-aa-timeStampToken timestamp attribute while preserving Authenticode timestamp behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the NuGet author signed-attribute profile needed for publisher metadata: signing-time, commitment-type proof-of-origin, and signing-certificate-v2. Remote signing now obtains the signer certificate before hashing CMS signed attributes so the signing-certificate-v2 ESSCertIDv2 value is part of the signed payload.

This makes Linux-generated NuGet signatures classify as Author signatures in NuGet tooling, which enables NuGetPackageExplorer to display the Publisher UI for packages signed through Azure Artifact Signing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The NuGet author-signature path needs a helper that assembles CMS SignedData from explicit content, digest, signer material, signature bytes, detached-content behavior, and prebuilt signed attributes. Allow Clippy's argument-count lint for this narrowly scoped helper so the portable-clippy CI job passes without changing behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Import and clean up PR #10's Linux Azure Artifact Signing NuGet work by hardening certificate parsing, making CMS content/timestamp modes explicit, fixing portable NuGet split-signing semantics, and expanding deterministic package signing coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use stable NuGet author attributes for the two-step external signing CLI path so the prehash and assembled CMS reconstruct the same authenticated attributes. Keep one-shot signing on timestamped author attributes and extend tests around the assembled prehash.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mamoreau-devolutions Marc-André Moreau (mamoreau-devolutions) merged commit fda60ff into master May 24, 2026
36 checks passed
@mamoreau-devolutions Marc-André Moreau (mamoreau-devolutions) deleted the mamoreau-devolutions/nuget-signing-pr branch May 24, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants