dotnet / dotnet/dotnet-api-docs
ECDsa.ImportSubjectPublicKeyInfo is not documented as throwing PlatformNotSupportedException
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
**Issue description**
`System.Security.Cryptography.ECDsa.ImportSubjectPublicKeyInfo` can throw a `PlatformNotSupportedException` when importing keys that do not have underlying Windows OS support, such as a `secP256k1` key on Windows Server 2012 R2 (Windows 6.3 build 9600).
The code that throws this exception on .NET 5.0 can be found [here](https://github.com/dotnet/runtime/blob/release/5.0/src/libraries/Common/src/System/Security/Cryptography/ECCng.ImportExport.cs#L509-L514) and is also present under .NET 6.0.
**Target framework**
- [X] .NET Core
dotnet --info output or About VS info
```console
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
No SDKs were found.
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNe
tCore.App]
Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNe
tCore.App]
Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspN
etCore.App]
Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNe
tCore.App]
Microsoft.AspNetCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspN
etCore.App]
Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNe
tCore.App]
Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.
App]
Microsoft.NETCore.App 1.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.
App]
Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.
App]
Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore
.App]
Microsoft.NETCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore
.App]
Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.
App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
```
Contributor guide
Assessment
This issue has not been assessed yet.