-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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 X509Certificate2.RawDataMemory #57835
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks Issue DetailsCloses #57448
|
I didn't go with the custom MemoryManager trick. For one I would probably have a difficult time figuring out how to do it correctly, and for two because it still feels a bit unnecessary to me. |
Should we doc that the returned |
What would documentation like that look like? I... think... given the API shape it's a reasonable expectation (otherwise it'd be a Would codifying in a test be more reasonable, or is that not strong enough? (I'm starting to think the test should exist regardless... let me add that). |
That's probably good enough honestly. Get the |
{ | ||
ReadOnlyMemory<byte> first = cert.RawDataMemory; | ||
ReadOnlyMemory<byte> second = cert.RawDataMemory; | ||
Assert.True(first.Span == second.Span, "RawDataMemory returned different values."); |
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.
It's quite rare to see someone use == with spans and have it actually be correct ;-)
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.
Thanks also for the unit test update!
Closes #57448