- Notifications
You must be signed in to change notification settings - Fork1.6k
Document ordering guarantee for X509Chain.ChainElements collection#11475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…unctuationCo-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
…ocumentationCo-authored-by: vcsjones <361677+vcsjones@users.noreply.github.com>
...p/System.Security.Cryptography.X509Certificates/X509Chain/Overview/chainelements-ordering.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: bartonjs <10642668+bartonjs@users.noreply.github.com>
...p/System.Security.Cryptography.X509Certificates/X509Chain/Overview/chainelements-ordering.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…xampleCo-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
20a51c9
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Summary
This PR clarifies the ordering of certificates in the
X509Chain.ChainElements
collection, which was previously undocumented and caused confusion for developers working with certificate chains across different platforms.Changes Made
Updated the documentation for the
ChainElements
property inX509Chain.xml
to include:1.Explicit Ordering Guarantee
Added clear statement that the collection is ordered from end-entity (leaf) certificate at index 0 to trust anchor (root certificate) at the final index.
2.Cross-Platform Consistency References
CERT_CHAIN_CONTEXT
structure behavior wherergpChain[0]
is the end certificateX509_STORE_CTX_get0_chain()
which returns certificates ordered from leaf to root3.Practical Code Example
Added demonstration showing how to reliably access certificates by their position in the chain:
Impact
This documentation enhancement:
The changes are minimal (22 lines added) and focused solely on clarifying existing behavior without modifying any implementation.
Fixes#11359.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.