Open vcsjones opened 2 years ago
Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones See info in area-owners.md if you want to be subscribed.
Author: | vcsjones |
---|---|
Assignees: | - |
Labels: | `api-suggestion`, `area-System.Security` |
Milestone: | - |
Looks good as proposed.
There may be some interesting edge cases around null vs empty (and therefore the default ReadOnlySpan vs a zero-width slice) which probably warrant testing (or proving that null and empty are the same to CNG)
namespace System.Security.Cryptography {
public partial struct CngProperty {
public CngProperty(string name, ReadOnlySpan<byte> value, CngPropertyOptions options);
}
}
I can take a look at it. You are welcome to assign me :smile:
Background and motivation
There is an internal constructor on
CngProperty
that accepts thevalue
as aReadOnlySpan<byte>
.https://github.com/dotnet/runtime/blob/be20c44826bc55d201c406f4ac007d24ed7a9137/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngProperty.cs#L30
I propose making this public so that callers that have data as a
ReadOnlySpan<byte>
don't need to convert it to abyte[]
first, and then get copied, again, since it keeps a defensive copy.API Proposal
API Usage
Alternative Designs
No response
Risks
No response