-
Notifications
You must be signed in to change notification settings - Fork 1.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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: jeffhandley <[email protected]>
Copilot finished work on behalf of
jeffhandley
June 19, 2025 06:47
jeffhandley
approved these changes
Jun 19, 2025
gewarren
reviewed
Jun 19, 2025
xml/System.Security.Cryptography.X509Certificates/X509Chain.xml
Outdated
Show resolved
Hide resolved
xml/System.Security.Cryptography.X509Certificates/X509Chain.xml
Outdated
Show resolved
Hide resolved
xml/System.Security.Cryptography.X509Certificates/X509Chain.xml
Outdated
Show resolved
Hide resolved
…unctuation Co-authored-by: gewarren <[email protected]>
Copilot finished work on behalf of
gewarren
June 19, 2025 08:07
vcsjones
reviewed
Jun 19, 2025
xml/System.Security.Cryptography.X509Certificates/X509Chain.xml
Outdated
Show resolved
Hide resolved
…ocumentation Co-authored-by: vcsjones <[email protected]>
Copilot finished work on behalf of
vcsjones
June 19, 2025 14:57
bartonjs
reviewed
Jun 19, 2025
...p/System.Security.Cryptography.X509Certificates/X509Chain/Overview/chainelements-ordering.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: bartonjs <[email protected]>
Copilot finished work on behalf of
bartonjs
June 19, 2025 17:13
bartonjs
approved these changes
Jun 19, 2025
gewarren
reviewed
Jun 19, 2025
...p/System.Security.Cryptography.X509Certificates/X509Chain/Overview/chainelements-ordering.cs
Outdated
Show resolved
Hide resolved
…xample Co-authored-by: gewarren <[email protected]>
Copilot finished work on behalf of
gewarren
June 19, 2025 19:09
jeffhandley
approved these changes
Jun 20, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 more Copilot coding agent tips in the docs.