Overview
Validation.PackageSigning.RevalidateCertificate is a standalone .NET 4.7.2 console application that runs as a scheduled Windows service. It performs two complementary maintenance tasks that keep the NuGet package-signing trust model up to date:
- Signature promotion — scans
PackageSignaturerows that are in theInGracePeriodstatus and advances any that are now fully promotable toValid. - Certificate revalidation — finds end-certificates whose last verification timestamp is older than the configured staleness window and re-enqueues them for fresh verification by the certificate validation pipeline.
Revoked certificates are explicitly excluded from revalidation. Certificate Authorities do not drop revocation status, so re-checking a revoked certificate would be wasteful and could produce misleading results.
Role in the NuGet Gallery Ecosystem
Upstream: Package Signing Pipeline
Packages receive
InGracePeriod signatures when they are first signed. This job promotes those signatures to Valid once all certificate chain checks pass.Downstream: Certificate Validator
Certificate revalidation messages are published to an Azure Service Bus topic. A separate certificate validator service consumes those messages and updates
EndCertificate status in the shared validation database.Shared DB: Validation Entities
Reads and writes
PackageSignature, EndCertificate, and EndCertificateValidation rows via IValidationEntitiesContext — the EF6-based context owned by Validation.PackageSigning.Core.Observability: Application Insights
All major operations are wrapped with duration tracking and error metrics via
ITelemetryService, surfacing data to Application Insights through NuGet.Services.Logging.Key Files and Classes
Dependencies
Internal Project References
Transitive NuGet Packages (key ones)
Configuration Reference
All settings live under the"RevalidateJob" key in the job’s configuration source.
Notable Patterns and Implementation Details
Chunked, iterative design. Neither
PromoteSignaturesAsync nor RevalidateStaleCertificatesAsync processes every eligible record in a single pass. The job is expected to be scheduled frequently (e.g. every few minutes) so that the total work is spread across many executions without holding long-running transactions or overwhelming Service Bus.Signature promotion uses a nested scan loop.
FindPromotableSignaturesAsync pages through InGracePeriod author signatures in creation order, accumulating promotable ones until the batch size is reached or all candidates are exhausted. This avoids a single unbounded query while still being precise about which signatures qualify.Telemetry Metrics
Deployment
The job ships as a NuGet package (Validation.PackageSigning.RevalidateCertificate) containing the compiled net472 binaries and four deployment artifacts:
Scripts/PreDeploy.ps1— pre-deployment teardown hook (Octopus Deploy).Scripts/PostDeploy.ps1— installs or reconfigures the job as a Windows service via NSSM.Scripts/Functions.ps1— shared PowerShell helpers (Install-NuGetService).Scripts/nssm.exe— Non-Sucking Service Manager binary, bundled for zero-dependency service installation.