Closed atykhyy closed 2 weeks ago
Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones
Unless I'm missing something, the documentation doesn't say that base64 will work, which means there's not an obvious place to say that it sometimes won't.
FWIW, these constructors are all [Obsolte]
in .NET 9 and beyond, and the replacement methods do not accept base64 on any OS.
Ah, I see, some of the overloads mention it, some don't. And when they say base64 they clearly meant PEM.
So, OK, the docs do need a bit of cleanup here.
Type of issue
Missing information
Description
[Enter feedback here] Constructors which take byte arrays or byte spans accept base64-encoded data on Windows, but not on Linux. This is a known issue in dotnet: https://github.com/dotnet/runtime/issues/47005 Documentation ought to reflect this, so people don't waste their time chasing down long closed issues when their code throws an exception.
Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2.-ctor?view=net-8.0
Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Security.Cryptography.X509Certificates/X509Certificate2.xml
Document Version Independent Id
b788c84c-ff5b-eb91-fee1-c09098d58696
Article author
@dotnet-bot