Files
Cristi Pogacean 5fa272d89a Fix instance-scoped certificate store resolution and consumers (#4546)
## Summary
Route certificate operations through the providers registered on the
configured manager, so custom stores work consistently during
validation, key loading, provisioning and GDS operations.

- Add optional `ICertificateStoreResolver`, implemented by
`CertificateManager`, without adding members to `ICertificateManager` or
removing existing public signatures.
- Use scoped resolution for configuration validation, startup and
cold-cache private-key lookup, application certificate
provisioning/reuse/deletion, existing-key GDS signing requests, and
hosted TrustList access.
- Preserve built-in lookup when no resolver is available, private-key
lookup fallbacks, access checks and transaction behavior. Resolver
failures do not silently fall back to Directory. Returned stores remain
caller-owned; TrustList retains cached-store disposal.
- Add regression coverage for instance isolation, mixed provider types,
real private-key reuse, rotation lookup, cancellation/failure disposal,
unavailable-key rejection, CSR output and TrustList lifetime. Document
the optional capability.

Fixes #4527
Fixes #4528
Fixes #4529
Fixes #4530
Fixes #4531

## Validation
Change-scoped Release tests on Windows, on base `5d26f6f43`:

| Fixture selection | net10.0 | net48 |
| --- | ---: | ---: |
| CertificateManagerFactoryTests + CertificateManagerTests | 71 passed |
71 passed |
| ApplicationInstanceTests | 56 passed | 56 passed |
| TrustListTests + ConfigurationNodeManagerPushTests | 147 passed | 147
passed |

All six selections exited 0 with zero failures or skips. Changed-file
whitespace verification and `git diff --check` passed.

Fresh no-fix comparisons retained the new resolver API/manager
implementation, but reversed the validation, provisioning and CSR
consumer fixes: validation had 2 custom-store failures / 1 built-in
control pass; provisioning had 4 custom-store failures / 1 built-in
control pass; CSR had 1 custom-store failure / 1 built-in control pass.
Failures reported unknown custom store types or invalid custom trust
stores. All consumer source changes were restored, rebuilt, and the full
focused net10.0 selections passed again.

Earlier TrustList regression evidence is recorded in #4531: its before
comparison retained the constructor injection boundary while exercising
the old store-opening path. It was not a test against an entirely
unextended API.

The complete platform/framework matrix is left to PR CI; no full local
matrix or completed CI qualification is claimed. Local restore used
command-line-only NuGet v2/feed-audit overrides; no repository feed,
test or contribution guidance was changed.
2026-09-25 12:13:31 +00:00
..