3

I develop Xamarin.Forms application and need to use ECDsa digital signature. I've tried to use System.Security.Cryptography methods for ECDsa (in Xamarin.Forms CngKey.Create shows "operation not implemented" error), but because Mono.Android doesn't support it (Are ECDSA and ECDH available for mono?), I have no idea how to do it. So could you, please, give me advice on how to use ECDsa digital signature in my Android application?
Also, I kinda don't fully understand the principles of Mono, .Net and PCL libraries, so maybe the solution is in changing the way I develop app in Xamarin.
Moreover, my Android is ver.4.4.0, so then solution should support old devices.

  • Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, [describe the problem](https://meta.stackoverflow.com/questions/254393) and what has been done so far to solve it. – Dwhitz May 20 '19 at 09:58
  • 1
    @Dwhitz thanks, I've edited my post about what I tried to use, BUT, even some very opinionated answer is what I need, because I am really looking for any answer. And if you try to hint at usage of [link](https://softwarerecs.stackexchange.com), I find this site dead a bit, moreover there are no related posts for my problem, so I'm not sure if I get any help there. – Drovosek2703 May 20 '19 at 10:30
  • Did you try `ECDsa.Create()`, instead of using specific derived types? – bartonjs May 21 '19 at 14:49
  • @bartonjs Thanks for reply. Yeah, I've tried, it shows the same error "Operation is not implemented". As I can see [here](http://docs.go-mono.com/?link=N%3aSystem.Security.Cryptography), Mono does not support any ECDsa method from .Net. Sadly. – Drovosek2703 May 22 '19 at 06:01

1 Answers1

2

Have a look at https://github.com/onovotny/bc-csharp/tree/netstandard . It is a portable version (.NET 4, .NET Standard 1.0-2.0, WP, Silverlight, MonoAndroid, Xamarin.iOS, .NET Core) of popular cryptographic algorithms.

According to their documentation at https://www.bouncycastle.org/csharp/ it supports ECDSA.

It is available on NuGet https://www.nuget.org/packages/Portable.BouncyCastle/

  • Oh. My. God. Thank you so much! This portable library really works in my app. I've found Bouncy Castle before, but the original version didn't work. Although it doesn't has such easy methods as .Net, but at least it works, and it the most important thing. – Drovosek2703 May 22 '19 at 08:51