Skip to content

Remove CmsSigner.HasPrivateKey#117113

Merged
PranavSenthilnathan merged 1 commit intodotnet:mainfrom
PranavSenthilnathan:slhdsa-remove-hasprivatekey
Jun 28, 2025
Merged

Remove CmsSigner.HasPrivateKey#117113
PranavSenthilnathan merged 1 commit intodotnet:mainfrom
PranavSenthilnathan:slhdsa-remove-hasprivatekey

Conversation

@PranavSenthilnathan
Copy link
Member

Closes #116282

@PranavSenthilnathan PranavSenthilnathan added this to the 10.0.0 milestone Jun 28, 2025
@PranavSenthilnathan PranavSenthilnathan self-assigned this Jun 28, 2025
Copilot AI review requested due to automatic review settings June 28, 2025 03:10
Copy link
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 removes the obsolete HasPrivateKey property from CmsSigner, deletes its public API surface, and removes the accompanying tests.

  • Remove HasPrivateKey from CmsSigner.cs and reference assembly
  • Drop tests in CmsSignerTests.cs that referenced HasPrivateKey
  • Update ref assembly System.Security.Cryptography.Pkcs.netcoreapp.cs to no longer expose HasPrivateKey

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/CmsSignerTests.cs Removed tests for HasPrivateKey
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSigner.cs Deleted the HasPrivateKey property declaration
src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.netcoreapp.cs Removed HasPrivateKey from public ref API
Comments suppressed due to low confidence (2)

src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSigner.cs:34

  • If you have public XML docs or markdown that mention HasPrivateKey, update them to reflect the removal and direct consumers to use PrivateKey nullity checks instead.
            set => _privateKey = value;

src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/CmsSignerTests.cs:49

  • [nitpick] Consider adding tests for scenarios where PrivateKey is null or set to ensure the replacement null-check behavior works as expected now that HasPrivateKey is gone.
        [Fact]

@dotnet-policy-service
Copy link
Contributor

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

@PranavSenthilnathan PranavSenthilnathan merged commit d643f64 into dotnet:main Jun 28, 2025
83 of 89 checks passed
@PranavSenthilnathan PranavSenthilnathan deleted the slhdsa-remove-hasprivatekey branch June 28, 2025 23:20
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: SLH-DSA

3 participants