Add S.S.C.Cose with COSE Sign1 support#64461
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: @dotnet/area-system-security, @vcsjones |
...s/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderLabel.cs
Outdated
Show resolved
Hide resolved
...s/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderLabel.cs
Outdated
Show resolved
Hide resolved
...s/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderLabel.cs
Outdated
Show resolved
Hide resolved
...s/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderLabel.cs
Outdated
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Outdated
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Outdated
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Outdated
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Outdated
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Outdated
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Outdated
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Show resolved
Hide resolved
...ies/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderMap.cs
Outdated
Show resolved
Hide resolved
...aries/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseMessage.cs
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/ref/System.Security.Cryptography.Cose.csproj
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/src/System.Security.Cryptography.Cose.csproj
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/src/System.Security.Cryptography.Cose.csproj
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/src/System.Security.Cryptography.Cose.csproj
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/src/System.Security.Cryptography.Cose.csproj
Show resolved
Hide resolved
...s/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderLabel.cs
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Outdated
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Show resolved
Hide resolved
.../System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseSign1Message.cs
Outdated
Show resolved
Hide resolved
...ies/System.Private.CoreLib/src/System/Runtime/Versioning/RequiresPreviewFeaturesAttribute.cs
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/src/System.Security.Cryptography.Cose.csproj
Show resolved
Hide resolved
...s/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderLabel.cs
Outdated
Show resolved
Hide resolved
...s/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderLabel.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography.Cose/tests/CoseHeaderLabelTests.cs
Outdated
Show resolved
Hide resolved
bartonjs
left a comment
There was a problem hiding this comment.
As long as someone who knows about building things signs off on ProjectRef vs PackageRef, and @tannergooding or someone can give a grunt of assent regarding the RequiresPreview attribute, I think that we can call this good enough for first partner preview.
src/libraries/System.Security.Cryptography.Cose/ref/System.Security.Cryptography.Cose.cs
Outdated
Show resolved
Hide resolved
...aries/System.Security.Cryptography.Cose/tests/System.Security.Cryptography.Cose.Tests.csproj
Show resolved
Hide resolved
safern
left a comment
There was a problem hiding this comment.
Other than a few comments/questions, build changes look good.
tests: add test project to exclusion list of local browser runs
buyaa-n
left a comment
There was a problem hiding this comment.
Left a NIT, overall attributes annotations LGTM
| public bool Verify(System.Security.Cryptography.ECDsa key, System.ReadOnlySpan<byte> content) { throw null; } | ||
| [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] | ||
| public bool Verify(System.Security.Cryptography.RSA key) { throw null; } | ||
| [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] |
There was a problem hiding this comment.
NIT: probably better to apply the attribute at the type level as all membrs have it except internal constructor
There was a problem hiding this comment.
Given that is a nit and the CI finished mostly clean, I will address this in a future PR.
There was a problem hiding this comment.
One a second thought, we shouldn't move the attribute to the type since the internal .ctor is used in an API (CoseMessage.DecodeSign1) that can be called from browser.
| internal CoseSign1Message(CoseHeaderMap protectedHeader, CoseHeaderMap unprotectedHeader, byte[]? content, byte[] signature, byte[] protectedHeaderAsBstr) | ||
| : base(protectedHeader, unprotectedHeader, content, signature, protectedHeaderAsBstr) { } | ||
|
|
||
| [UnsupportedOSPlatform("browser")] |
There was a problem hiding this comment.
browser-compat is supposed to be opt-in, so I wouldn't expect this to trip.
That is right, by defualt it should not warn for cross platform builds, but browser team wanted to see/propogate the warning for cross-platform builds in runtime repo
Ahhh. Thanks for the explanation :) |
Fixes #32121.
Contributes to #62600.