dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.91k stars 4.63k forks source link

Consider exposing crv values for ECDSA keys #30548

Closed scottbrady91 closed 4 years ago

scottbrady91 commented 5 years ago

When handling ECDSA keys, it can be useful to know the corresponding crv value defined in rfc7518.

Currently, only the oidc and friendly name are exposed.

There are some mappings in IdentityModel's ECDsaAdapter, but these methods are private.

bartonjs commented 5 years ago

Mostly the corefx cyptography only works at the bottom layer, which is defined in terms of the OID.

Exposing the JWE identifiers feels like it belongs more wiht the JWE/JWT layer, which is (I believe) https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/

scottbrady91 commented 5 years ago

I was going to open it there but @brentschmaltz told me to open it here :p

bartonjs commented 5 years ago

I can't think of a reason why it would belong here... it'd either be out of date or would slow down the JWE/JWT layer by waiting on us to add something to a mapping table (since we don't have any reason to pay attention to JWE evolution... and only ship new public members about once a year).

I think the easy answer is that in the corefx layer we usually only host information that we need ourselves, and we don't need the JWE identifiers. If we needed them because of a new mode in PKCS#7, or something like that, then we'd have a different story.

scottbrady91 commented 5 years ago

@bartonjs thanks :) I'll move this to the Identity Model repo