-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DotNetUtilities class only works on Windows #160
Comments
And finally today I bumped on this problem myself after publishing my projects into linux-based hosts. Isn't it resolved yet? |
+1. This dotnet core issue also seems to indicate there is no need for the |
Indeed, doing
instead of
fixes the issue on Linux, I guess this could be easily factored into the library |
wow, a great simple solution, will try it tomorrow in the office :D |
just note, that there is a problem on Windows with the above code (dotnet/runtime#23749), right now I need to use this:
which handles conversion well on both Windows and Linux |
Thanks,its resolve my question! |
Good evening,
I'm porting a .NET Framework library that uses BouncyCastle to .NET Standard, and I'm using the
Portable.BouncyCastle
nuget package for this. I'm running into an issue where our code relies onthe
DotNetUtilities.ToRSA()
method. This method is available in the portable version, but it only works on Windows, due to relying on the key container functionality that only exists on Windows. This is the stacktrace on Linux:So, the build works but it does not work at runtime, which is not desirable for a portable library.
Side question: I'm a bit confused why this function even uses the key container functionality? I was surprised to find that the keys were being persisted at all, given the function just setting up an
RSACryptoServiceProvider
. Of course, there could be valid reasons for this but I found it strange.I think either this class should be removed from .NET Standard builds, or perhaps conditionally compiled to only expose APIs that can work cross-platform, as the conversion tools are quite useful.
Related issue: #113 (comment)
The text was updated successfully, but these errors were encountered: