Skip to content

Remove .NET Framework remarks (System.Security.Cryptography)#12655

Open
gewarren wants to merge 1 commit into
dotnet:mainfrom
gewarren:fw-remarks-system-security-cryptography
Open

Remove .NET Framework remarks (System.Security.Cryptography)#12655
gewarren wants to merge 1 commit into
dotnet:mainfrom
gewarren:fw-remarks-system-security-cryptography

Conversation

@gewarren
Copy link
Copy Markdown
Contributor

.NET Framework API ref has moved to its own repo (https://github.com/dotnet/dotnetfw-api-docs), so we can clean up .NET Framework remarks, exceptions, and code examples out of this repo. Contributes to #12513.

Removes remarks and examples related to:

  • .NET Framework versions
  • Code-access security
  • Configuring apps via app.config file
  • App domains

Also remarks all remarks from obsolete APIs.

Hide whitespace changes

Copilot AI review requested due to automatic review settings May 24, 2026 03:01
@gewarren gewarren requested a review from a team as a code owner May 24, 2026 03:01
@github-actions github-actions Bot added the area-System.Security Issues related to security practices for .NET developers. label May 24, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the .NET API reference XML docs in System.Security.Cryptography* to remove .NET Framework-specific remarks, exceptions, and usage notes now that .NET Framework API reference docs have moved to a separate repo.

Changes:

  • Removed or rewrote remarks that referenced .NET Framework-only features and behaviors (CAS, app.config, AppDomains, framework-version notes).
  • Normalized several exception descriptions to remove framework qualifiers (for example, “In all cases.”).
  • Cleaned up and reflowed various remarks blocks and IMPORTANT/NOTE callouts.

Reviewed changes

Copilot reviewed 41 out of 41 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
xml/System.Security.Cryptography/SymmetricAlgorithm.xml Rewords remarks to drop .NET Framework phrasing and adjusts Create() docs.
xml/System.Security.Cryptography/SHA256.xml Removes .NET Framework-specific return/exception details for Create overloads.
xml/System.Security.Cryptography/RSACryptoServiceProvider.xml Removes AppDomain/version-specific wording from UseMachineKeyStore remarks.
xml/System.Security.Cryptography/RSACng.xml Removes .NET Framework version-specific exception behavior from VerifyHash docs.
xml/System.Security.Cryptography/RSA.xml Removes .NET Framework version notes and normalizes exception text.
xml/System.Security.Cryptography/RijndaelManaged.xml Removes .NET Framework vs .NET Core block-size distinctions, simplifying to modern .NET behavior.
xml/System.Security.Cryptography/ProtectedData.xml Rewords Windows-only support notes and adds/updates PlatformNotSupportedException text.
xml/System.Security.Cryptography/Oid.xml Updates property summaries to reflect init-only narrative (but signatures still show settable).
xml/System.Security.Cryptography/KeyedHashAlgorithm.xml Removes .NET Framework versioning notes; normalizes PNSE text.
xml/System.Security.Cryptography/HMACSHA512.xml Removes legacy .NET Framework 2.0 SP notes and replaces with placeholder remarks.
xml/System.Security.Cryptography/HMACSHA384.xml Removes legacy .NET Framework 2.0 SP notes and replaces with placeholder remarks.
xml/System.Security.Cryptography/HMAC.xml Removes config-system mention and normalizes PNSE text.
xml/System.Security.Cryptography/HashAlgorithm.xml Removes obsoletion/version notes and normalizes PNSE text.
xml/System.Security.Cryptography/FromBase64Transform.xml Converts markdown remarks to XML paragraphs for CanTransformMultipleBlocks.
xml/System.Security.Cryptography/ECDsa.xml Rewords remarks/parameter guidance to remove .NET Framework mention.
xml/System.Security.Cryptography/ECDiffieHellmanPublicKey.xml Rewords PlatformNotSupportedException descriptions to remove framework qualifiers.
xml/System.Security.Cryptography/ECDiffieHellmanCngPublicKey.xml Normalizes whitespace and replaces some .NET Framework-specific remarks/exceptions.
xml/System.Security.Cryptography/ECDiffieHellmanCng.xml Removes argument/format exception documentation and normalizes PNSE text.
xml/System.Security.Cryptography/ECDiffieHellman.xml Rewords remarks to remove .NET Framework mention and reformats lists.
xml/System.Security.Cryptography/DSACryptoServiceProvider.xml Removes AppDomain/version-specific wording from UseMachineKeyStore remarks.
xml/System.Security.Cryptography/CryptoStream.xml Removes .NET Framework comparison from partial-read IMPORTANT notes and async remarks.
xml/System.Security.Cryptography/CryptoConfig.xml Removes .NET Framework config file references and partial-trust/CAS-related remarks.
xml/System.Security.Cryptography/CngProvider.xml Removes “service packs / .NET Framework releases” wording from remarks.
xml/System.Security.Cryptography/CngKeyBlobFormat.xml Removes “service packs / .NET Framework releases” wording from remarks.
xml/System.Security.Cryptography/CngAlgorithmGroup.xml Removes “service packs / .NET Framework releases” wording from remarks.
xml/System.Security.Cryptography/CngAlgorithm.xml Removes “service packs / .NET Framework releases” wording from remarks.
xml/System.Security.Cryptography/AsymmetricAlgorithm.xml Removes config-system mention and normalizes PNSE text.
xml/System.Security.Cryptography/AsnEncodedData.xml Rewords remarks to remove .NET Framework mention and trims extra whitespace.
xml/System.Security.Cryptography.Xml/SignedXml.xml Removes .NET Framework version-specific certificate-verification notes.
xml/System.Security.Cryptography.Xml/EncryptedXml.xml Rewords remarks to remove .NET Framework mention and trims redundant constructor remarks.
xml/System.Security.Cryptography.X509Certificates/X509Store.xml Removes .NET Framework version-based IDisposable guidance and replaces dispose remarks.
xml/System.Security.Cryptography.X509Certificates/X509ExtensionCollection.xml Rewords SyncRoot remarks to remove .NET Framework phrasing.
xml/System.Security.Cryptography.X509Certificates/X509Extension.xml Rewords list intro to remove .NET Framework mention and reformats list.
xml/System.Security.Cryptography.X509Certificates/X509ChainStatusFlags.xml Removes .NET Framework-introduced version note for certain flags.
xml/System.Security.Cryptography.X509Certificates/X509Chain.xml Removes .NET Framework version-based IDisposable guidance and replaces dispose remarks.
xml/System.Security.Cryptography.X509Certificates/X509Certificate2.xml Removes .NET Framework-only permission/version notes and normalizes PNSE text.
xml/System.Security.Cryptography.X509Certificates/X509Certificate.xml Removes .NET Framework version-based IDisposable guidance and replaces various remarks/exceptions.
xml/System.Security.Cryptography.Pkcs/SignerInfo.xml Removes CAS permission notes and normalizes countersignature remarks spacing.
xml/System.Security.Cryptography.Pkcs/SignedCms.xml Removes CAS permission notes; normalizes silent parameter doc and exception text.
xml/System.Security.Cryptography.Pkcs/EnvelopedCms.xml Removes .NET Framework vs .NET Core algorithm-default notes and CAS permission remarks.
xml/System.Security.Cryptography.Pkcs/CmsSigner.xml Removes .NET Framework-only support note and normalizes PNSE text.

<exception cref="T:System.NotSupportedException">The operating system does not support this method.</exception>
<exception cref="T:System.OutOfMemoryException">The system ran out of memory while encrypting the data.</exception>
<exception cref="T:System.PlatformNotSupportedException">.NET Core and .NET 5+ only: Calls to the <c>Protect</c> method are supported on Windows operating systems only.</exception>
<exception cref="T:System.PlatformNotSupportedException">The operation system is not Windows.</exception>
</ReturnValue>
<Docs>
<summary>Gets or sets the friendly name of the identifier.</summary>
<summary>Gets or initializes the friendly name of the identifier.</summary>
</ReturnValue>
<Docs>
<summary>Gets or sets the dotted number of the identifier.</summary>
<summary>Gets or initializes the dotted number of the identifier.</summary>

## Remarks
This constructor is called by classes that derive from the <xref:System.Security.Cryptography.ECDiffieHellman> class. The <xref:System.Security.Cryptography.ECDiffieHellmanCng> class is the only implementation that is currently included in the .NET Framework. For information about how to create a new implementation of the Elliptic Curve Diffie-Hellman (ECDH) algorithm, see the <xref:System.Security.Cryptography.ECDiffieHellman.Create*> method.
This constructor is called by classes that derive from the <xref:System.Security.Cryptography.ECDiffieHellman> class. The <xref:System.Security.Cryptography.ECDiffieHellmanCng> class is the only implementation that is currently included in the .NET. For information about how to create a new implementation of the Elliptic Curve Diffie-Hellman (ECDH) algorithm, see the <xref:System.Security.Cryptography.ECDiffieHellman.Create*> method.

> [!IMPORTANT]
> In .NET 6 and later versions, when `Stream.Read` or `Stream.ReadAsync` is called with a buffer of length `N`, the operation completes when either at least 1 byte has been read from the stream, or the underlying stream that it wraps returns 0 from a call to `Read`, indicating no more data is available. In .NET Framework, `Stream.Read` and `Stream.ReadAsync` do not return until all `N` bytes have been read from the stream or the underlying stream returns 0 from a call to `Read`. If your code assumes the `Read` methods won't return until all `N` bytes have been read, it could fail to read all the content. For more information, see [Partial and zero-byte reads in streams](/dotnet/core/compatibility/core-libraries/6.0/partial-byte-reads-in-streams).
> When `Stream.Read` or `Stream.ReadAsync` is called with a buffer of length `N`, the operation completes when either at least 1 byte has been read from the stream, or the underlying stream that it wraps returns 0 from a call to `Read`, indicating no more data is available. If your code assumes the `Read` methods won't return until all `N` bytes have been read, it could fail to read all the content. For more information, see [Partial and zero-byte reads in streams](/dotnet/core/compatibility/core-libraries/6.0/partial-byte-reads-in-streams).
Comment on lines +292 to +293
<para>Prior to .NET 5, only one block can be transformed at a time, so this property returns `false`.</para>
<para>Starting in .NET 5, multiple blocks can be transformed, so this property returns `true`.</para>
All cryptographic classes in the .NET Framework that hold sensitive data implement a `Clear` method. When called, the `Clear` method overwrites all sensitive data within the object with zeros and then releases the object so that it can be safely garbage collected. When the object has been zeroed and released, you should then call the `Dispose` method with the `disposing` parameter set to `True` to dispose of all managed and unmanaged resources associated with the object.


All cryptographic classes in .NET that hold sensitive data implement a `Clear` method. When called, the `Clear` method overwrites all sensitive data within the object with zeros and then releases the object so that it can be safely garbage collected. When the object has been zeroed and released, you should then call the `Dispose` method with the `disposing` parameter set to `True` to dispose of all managed and unmanaged resources associated with the object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Security Issues related to security practices for .NET developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants