Is there any way to convert a Org.BouncyCastle.X509.X509Certificate
to System.Security.Cryptography.X509Certificates.X509Certificate2
?
The inverse operation is easy, combining Org.BouncyCastle.X509.X509CertificateParser
with
System.Security.Cryptography.X509Certificates.X509Certificate2.Export()
.
Easy!!
And now I can validate certificate chain in the server:
Useful to validate pdf certifcates extracted with iTextSharp.
From https://github.com/dotnet/corefx/wiki/ApiCompat :
In other words, trying to use import throws an exception in .net core. You should now use:
but, according to the .net API analyzer (https://docs.microsoft.com/en-us/dotnet/standard/analyzers/api-analyzer),
I guess that is the best answer: