c# - Xamarin error: Pkcs does not exist in System.Security.Cryptography on Android -


i'm getting error cs0234: type or namespace name 'pkcs' not exist in namespace 'system.security.cryptography' (are missing assembly reference?) when compiling android.

the code shared library referenced in android , mono targets. android's target framework 4.4 (tried 5.0 no avail). mono .net 4.5.

android's version references mono.android , mono.security (2.0.5.0), mono version - system.security 4.0.0.0.

if add conditional compilation directive turn off android , leave mono, builds.

http://androidapi.xamarin.com/?link=t%3asystem.security.cryptography.pkcs.signedcms states android supports this. xamarin, however, not offer me system.security.dll , instead there mono.security in case of android.

how can system.security.cryptography.pkcs under android?

i'm pretty sure system.security.dll not supported xamarin.android (nor xamarin.ios). it's mistake docs exist xamarin.android.

i've been maintaining (slight) fork of bouncy castle cryptography library use xamarin.android , xamarin.ios here: https://github.com/jstedfast/bc-csharp - you'll want check out vs2010 branch (my changes not made on master branch).

in vs2010 branch, you'll find bouncycastle.android.csproj , bouncycastle.ios.csproj can use when targeting 1 of xamarin platforms.

i'm not sure using signedcms for, since it's used s/mime, might interested in s/mime library works on xamarin platforms called mimekit using aforementioned bouncycastle fork. if that's not need for, may still want check out examples of how use bouncycastle's crypto equivalent of signedcms stuff. check out securemimecontext , defaultsecuremimecontext examples (specifically sign() , encapsulatedsign() methods). windowssecuremimecontext code uses system.security.dll signedcms apis in encapsulatedsign() , sign() methods.

hope helps.


Popular posts from this blog