-
Notifications
You must be signed in to change notification settings - Fork 5.2k
SPKI and PKCS8 for Composite ML-DSA #119837
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
SPKI and PKCS8 for Composite ML-DSA #119837
Conversation
|
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 implements SPKI (Subject Public Key Info) and PKCS#8 support for Composite ML-DSA cryptographic algorithms. The primary purpose is to extend the existing Composite ML-DSA implementation to support standard cryptographic key formats for interoperability.
Key changes include:
- Added support for importing and exporting keys in SPKI and PKCS#8 formats
- Implemented encrypted PKCS#8 private key support with PEM encoding
- Extended test infrastructure with comprehensive validation for the new formats
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| CompositeMLDsaTestHelpers.cs | Added extensive helper methods for testing SPKI/PKCS#8 import/export operations |
| CompositeMLDsaMockImplementation.cs | Updated mock implementation to support PKCS#8 export testing |
| CompositeMLDsaImplementationTests.cs | Added comprehensive roundtrip tests for all new key formats |
| CompositeMLDsaFactoryTests.cs | Added validation tests for malformed ASN.1 encodings and PEM formats |
| CompositeMLDsaContractTests.cs | Added contract tests for new export methods and error handling |
| CompositeMLDsaManaged.cs | Implemented actual PKCS#8 private key export functionality |
| CompositeMLDsa.cs | Updated private key reader to handle raw key data instead of ASN.1 wrapper |
...m/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaTestHelpers.cs
Show resolved
Hide resolved
.../Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Outdated
Show resolved
Hide resolved
.../Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Outdated
Show resolved
Hide resolved
.../Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Outdated
Show resolved
Hide resolved
.../Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Outdated
Show resolved
Hide resolved
.../Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Outdated
Show resolved
Hide resolved
.../Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Outdated
Show resolved
Hide resolved
...Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaContractTests.cs
Outdated
Show resolved
Hide resolved
...Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaContractTests.cs
Outdated
Show resolved
Hide resolved
.../Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Outdated
Show resolved
Hide resolved
.../Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Show resolved
Hide resolved
.../Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Show resolved
Hide resolved
...ty/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaImplementationTests.cs
Outdated
Show resolved
Hide resolved
...ty/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaImplementationTests.cs
Show resolved
Hide resolved
...m/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaTestHelpers.cs
Show resolved
Hide resolved
...ty/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaImplementationTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/tests/System/Security/Cryptography/AsnUtils.cs
Outdated
Show resolved
Hide resolved
bartonjs
left a comment
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.
Just the one comment throwing a 2 into a binary number, then LGTM. And should be backported to 10 when ready.
|
/backport to release/10.0 |
|
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17869205178 |
|
@PranavSenthilnathan backporting to "release/10.0" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: SPKI and PKCS8 for Composite ML-DSA
Using index info to reconstruct a base tree...
M src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
CONFLICT (content): Merge conflict in src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/CompositeMLDsaFactoryTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 SPKI and PKCS8 for Composite ML-DSA
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
Closes #116998