Ordering of X509Chain.ChainElements #11359
Labels
area-System.Security
Issues related to security practices for .NET developers.
untriaged
New issue has not been triaged by the area owner
Describe the issue or suggestion
The current documentation for X509Chain.ChainElements does not specify the ordering of the returned certificates. Consumers of the API need to know whether element 0 is the leaf (end-entity) certificate or the root (trust anchor), and how intermediate certificates are ordered in between.
Suggested Improvements
Add explicit ordering guarantee
Include a statement such as:
Link to authoritative references
CERT_CHAIN_CONTEXT
guarantees thatrgpChain[0]
is the end certificate andrgpChain[cChain–1]
is the final chain element (root) (see CERT_CHAIN_CONTEXT struct).X509_STORE_CTX_get0_chain()
returns aSTACK_OF(X509)
ordered from leaf to root.Include a minimal example or unit test snippet
Demonstrate that:
Rationale
The text was updated successfully, but these errors were encountered: