Are X509Certificate2 classes only partially supported by unity?

I’ve been working around Unity refusing to return certificates in the LocalMachine > MY certificate store by locating the certificate using C++ and returning the located CertificateContext pointer to C#.

the C++ DLL is able to return a managed pointer to the located certificate context, however when instantiating the certificate instance using the pointer, I get a “PlatformNotSupportedException”…

System.PlatformNotSupportedException: Initializing `X509Certificate` from native handle is not supported. at System.Security.Cryptography.X509Certificates.X509Certificate..ctor (System.IntPtr handle) [0x0001c]

I know the C# code works as it’s pulled from one of my .Net C# libraries. I’ve also decompiled the X509Certificate2 and X509Certificate classes and it appears they are implemented with in the .net/mono/il2cpp backend unity uses for Windows Standalone builds.

@Reahreic same problem here… i noticed that it is working on Unity 2020 and not working on 2022 so seems to be a bug in native mono libs from Net.Framework