Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Portable.BouncyCastle cross-platform?

Will Portable.BouncyCastle works on Linux & MacOS if I reference it from an ASP.NET Core 2 web application? Will my ASP.NET Core 2 app still be cross-platform compatible?

like image 684
2 revs Avatar asked Jan 27 '23 15:01

2 revs


1 Answers

No it is not cross-platform. It uses some types like System.Security.Cryptography.CspParameters that are only implemented in .Net Core for Windows. See https://github.com/novotnyllc/bc-csharp/issues/6

Indeed, as of 2022-03-10, Portable.BouncyCastle still uses the RSACryptoServiceProvider(CspParameters) constructor, and .Net Core still has it stubbed out for non-Windows.

Just because something targets .Net Standard doesn't mean it works on non-Windows OSes. There are many .Net Core implementations of .Net Standard API that are just stubs which throw "not implemented on this platform" exceptions.

like image 153
Arnavion Avatar answered Feb 04 '23 22:02

Arnavion