Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 5, 2025

This PR adds documentation for a breaking change in .NET 10 Preview 7 where the CoseSigner.Key property may now return null.

Changes

The System.Security.Cryptography.Cose.CoseSigner.Key property has changed from type AsymmetricAlgorithm to AsymmetricAlgorithm? to support Post-Quantum Cryptography (PQC) algorithms like ML-DSA that don't derive from AsymmetricAlgorithm.

Previous behavior:

using RSA rsaKey = RSA.Create();
CoseSigner signer = new CoseSigner(rsaKey, RSASignaturePadding.Pss, HashAlgorithmName.SHA512);
AsymmetricAlgorithm key = signer.Key; // key was never null

New behavior:

using MLDsa mldsa = MLDsa.GenerateKey(MLDsaAlgorithm.MLDsa44);
CoseKey coseKey = new CoseKey(mldsa);
CoseSigner signer = new CoseSigner(coseKey);
AsymmetricAlgorithm? key = signer.Key; // key is null for non-AsymmetricAlgorithm keys

Documentation updates

  • Created: docs/core/compatibility/cryptography/10.0/cosesigner-key-null.md - Complete breaking change documentation following the standard template
  • Updated: docs/core/compatibility/10.0.md - Added entry to the Cryptography section table
  • Updated: docs/core/compatibility/toc.yml - Added navigation entry under Cryptography > .NET 10

The documentation explains the reason for the change (support for PQC algorithms), provides clear examples of both old and new behavior, and includes recommended actions for handling null values.

Fixes #46999.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


Internal previews

📄 File 🔗 Preview link
docs/core/compatibility/10.0.md Breaking changes in .NET 10
docs/core/compatibility/cryptography/10.0/cosesigner-key-null.md CoseSigner.Key can now be null
docs/core/compatibility/toc.yml docs/core/compatibility/toc

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] [Breaking change]: CoseSigner.Key may now be null Add breaking change documentation for CoseSigner.Key property nullability Aug 5, 2025
@Copilot Copilot AI requested a review from gewarren August 5, 2025 23:44
Copilot finished work on behalf of gewarren August 5, 2025 23:44
@gewarren gewarren marked this pull request as ready for review August 7, 2025 00:06
@gewarren gewarren requested a review from a team as a code owner August 7, 2025 00:06
@gewarren gewarren requested review from a team and PranavSenthilnathan August 7, 2025 21:47
@gewarren gewarren merged commit 4f74041 into main Aug 8, 2025
10 checks passed
@gewarren gewarren deleted the copilot/fix-46999 branch August 8, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Breaking change]: CoseSigner.Key may now be null

3 participants