Skip to content

Implement KeySizeInBytes on AesGcm and AesCcm. - #129770

Merged
vcsjones merged 3 commits into
mainfrom
copilot/implement-approved-api-72191
Jun 24, 2026
Merged

vcsjones merged 3 commits into
mainfrom
copilot/implement-approved-api-72191

Conversation

Copilot AI commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Implements #72191

Copilot AI and others added 3 commits June 23, 2026 20:20
Copilot AI review requested due to automatic review settings June 23, 2026 21:21
Copilot AI removed the request for review from Copilot June 23, 2026 21:21
@vcsjones vcsjones changed the title Update AES key size XML documentation Implement KeySizeInBytes on AesGcm and AesCcm. Jun 23, 2026
@vcsjones
vcsjones marked this pull request as ready for review June 23, 2026 21:22
Copilot AI review requested due to automatic review settings June 23, 2026 21:22
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a new public instance property, KeySizeInBytes, to AesGcm and AesCcm, allowing callers to query the key length used to construct an instance.

Changes:

  • Introduces KeySizeInBytes as a public property on AesGcm and AesCcm.
  • Initializes KeySizeInBytes in all relevant constructors (including obsolete AesGcm ctors).
  • Adds unit tests validating KeySizeInBytes for 128/192/256-bit keys and updates the ref assembly surface.
Show a summary per file
File Description
src/libraries/System.Security.Cryptography/tests/AesCcmTests.cs Adds coverage asserting AesCcm.KeySizeInBytes matches the provided key length.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.cs Ensures the obsolete AesGcm(ReadOnlySpan<byte>) constructor populates KeySizeInBytes.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.cs Adds KeySizeInBytes API and sets it in both constructors.
src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs Exposes KeySizeInBytes in the public ref contract for both AesGcm and AesCcm.
src/libraries/Common/tests/System/Security/Cryptography/AesGcmTests.cs Adds coverage asserting AesGcm.KeySizeInBytes across both obsolete and tag-size ctors (as applicable).
src/libraries/Common/src/System/Security/Cryptography/AesGcm.cs Adds KeySizeInBytes API and sets it in the tag-size constructor.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 0

@vcsjones
vcsjones merged commit 5efb24e into main Jun 24, 2026
89 of 93 checks passed
@vcsjones
vcsjones deleted the copilot/implement-approved-api-72191 branch June 24, 2026 03:17
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jun 25, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 26, 2026
@bartonjs bartonjs added the cryptographic-docs-impact Issues impacting cryptographic docs. Cleared and reused after documentation is updated each release. label Sep 11, 2026
@bartonjs bartonjs added the tracking This issue is tracking the completion of other related issues. label Oct 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Security cryptographic-docs-impact Issues impacting cryptographic docs. Cleared and reused after documentation is updated each release. tracking This issue is tracking the completion of other related issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants