Skip to content
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

Xamarin iOS issue #34

Open
leastprivilege opened this issue Aug 16, 2016 · 3 comments
Open

Xamarin iOS issue #34

leastprivilege opened this issue Aug 16, 2016 · 3 comments

Comments

@leastprivilege
Copy link

When adding 2.01 to a Xamarin project - I get

Could not install package 'System.Security.Cryptography.Cng 4.2.0'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

@wickedw
Copy link

wickedw commented Sep 5, 2018

Hi,

Just came across the Library this week.
With current support for .Net Standard 1.4 we should hopefully be able to get this working for Xamarin.

We have just installed NUGET to an iOS project and get the same error as above.

We have then taken the source code and tried to create a Xamarin .Net Standard 2.0 project from it, see how it fits together.

When running it in a test iOS project, we get a "cannot find "bcrypt.dll" at runtime" error.

Could someone clarify what is BCrypt.dll and where it should reside (on the platform or even in the project)

If these cannot be used on Xamarin, how difficult is it to replace the native/Bcrypt.cs and Ncrypt.cs files which call out to b/ncrypt.dll with something like -

https://github.com/neoKushan/BCrypt.Net-Core

OR

https://github.com/BcryptNet/bcrypt.net

Sorry currently know little about crypto algos so cannot easily replace ourselves, but willing to have a look with more information.

Thanks for your help

@dvsekhvalnov
Copy link
Owner

dvsekhvalnov commented Sep 5, 2018

Hi @wickedw ,

bcrypt.dll/ncrypt.dll usually provided on Windows OS and contains Microfost Crypto Primitives implementations. jose-jwt itself using native interface to bcrypt.dll/ncrypt.dll for features that not directly available as managed (.net) interfaces. Examples can be generating ephemeral EC keys or AES GCM mode.

Where possible jose-jwt tries to stick to managed interfaces for broader compatibility. But even using .NET interfaces sometimes not enough, for instance on Linux OS some interfaces simply throws NotImplementedException.

Can't really say much about Xamarin compatibility cause i never used it myself. Are you running into given exception for some specific signing or encryption algos? May be you can just stick to something that implemented on Xamarin instead?

I haven't seen projects you mentioned before, will take a look.

@wickedw
Copy link

wickedw commented Sep 5, 2018

Hi dvsekhvalnov,

Thanks for the prompt reply. We figured it was a windows OS system dll, thanks for clarification.

I think ideally Xamarin would need a pure .net Standard implementation that did not rely on any native windows dlls. For example, bcrypt.dll does not exist on iOS / Droid so needs an equivalent replacement for each platform in order to make those bcrypt / ncrypt calls.

Let me have a look at some options offline and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants