Skip to content

Add note about disposing certificates in chain elements to X509Chain #11042

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
merged 1 commit into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
>
> For apps that target the .NET Framework 4.5.2 and earlier versions, the <xref:System.Security.Cryptography.X509Certificates.X509Chain> class does not implement the <xref:System.IDisposable> interface and therefore does not have a `Dispose` method.

When disposing <xref:System.Security.Cryptography.X509Certificates.X509Chain>, the certificates in <xref:System.Security.Cryptography.X509Certificates.X509Chain.ChainElements> are not disposed. You should dispose of the certificates in this collection when the certificate instances are no longer needed.

## Examples
The following code example opens the current user's personal certificate store, allows you to select a certificate, then writes certificate and certificate chain information to the console. The output depends on the certificate you select.
Expand Down