-
Notifications
You must be signed in to change notification settings - Fork 5.2k
ML-KEM: X509Certificate2.GetMLKemPublicKey #114657
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
Conversation
|
Note regarding the |
1 similar comment
|
Note regarding the |
|
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
There was a problem hiding this 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 introduces an in-box implementation of X509Certificate2.GetMLKemPublicKey(), exposing the new ML-KEM API and adding the corresponding reflection metadata and unit tests.
- Implements GetMLKemPublicKey with proper XML documentation and experimental attributes.
- Updates the reference assembly to expose the new API.
- Adds unit tests and test data for various ML-KEM certificate scenarios.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509Certificate2.cs | Adds the new GetMLKemPublicKey() implementation with experimental support. |
| src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs | Updates the public contract to include GetMLKemPublicKey(). |
| src/libraries/Common/tests/System/Security/Cryptography/X509Certificates/MLKemCertTests.cs | Provides tests for the new ML-KEM API under different conditions. |
| src/libraries/Common/tests/System/Security/Cryptography/MLKemTestData.cs | Adds test data including certificate PEM strings for ML-KEM certificates. |
Files not reviewed (1)
- src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj: Language not supported
....Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509Certificate2.cs
Show resolved
Hide resolved
src/libraries/Common/tests/System/Security/Cryptography/X509Certificates/MLKemCertTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question about a test, otherwise LGTM
This provides an in-box implementation of
X509Certificate2.GetMLKemPublicKey().Originally, this change included the
X509CertificateKeyAccessorsfor Microsoft.Bcl.Cryptography. However, we cannot meaningfully test this until there is a Windows / .NET Framework implementation ofMLKem. The unit tests run for either NetCoreAppCurrent, which is .NET 10 and the implementation ofX509CertificateKeyAccessorswill be "Just call the one on X509Certificate2". The other target for the unit tests is .NET Framework, which would use the downlevel implementation, but we lack a functionMLKemon Windows at the moment.Instead of including a big chunk of untestable code, I decided to hold off on that part, for now.