-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Implement void AsnWriter.Encode #112921
Implement void AsnWriter.Encode #112921
Conversation
Note regarding the
|
1 similar comment
Note regarding the
|
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.
PR Overview
This PR implements a new void overload for AsnWriter.Encode to provide an encoding callback overload and updates various tests and reference assemblies accordingly. The changes include adding the new overload with XML documentation, updating tests to cover the new API, and cleaning up lambda callback return values in several crypto-related files.
Reviewed Changes
File | Description |
---|---|
src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.cs | Added new void Encode overload with accompanying documentation. |
src/libraries/System.Formats.Asn1/tests/Writer/SimpleWriterTests.cs | Added test cases to validate behavior of the new Encode overload and verify exception conditions when the writer is unbalanced. |
src/libraries/System.Formats.Asn1/tests/Writer/Asn1WriterTests.cs | Updated tests to check that the callback receives the correct state and encoded data. |
src/libraries/System.Formats.Asn1/tests/Writer/PushPopSetOf.cs | Added tests to ensure that encoding while unbalanced correctly throws an exception. |
src/libraries/System.Formats.Asn1/ref/System.Formats.Asn1.cs | Updated reference assemblies with the new void Encode declaration. |
Other files (SignerInfo.cs, DSAKeyFormatHelper.cs, X509Pal.Android.cs, X509Pal.macOS.cs) | Cleaned up lambda callbacks by removing unnecessary return values to align with the new void overload. |
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more
src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.cs
Outdated
Show resolved
Hide resolved
...raries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfo.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
Closes #112675