Hi,
I would like to know if the cryptography class above is ever going to be supported in Xamarin for Android and IOS ? I am asking this because it is supported by .Net Standard 2.1 and dotnet Core 2.1. I am hitting error thrown saying that the feature is not implemented.
https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.ecdiffiehellman
Answers
Cryptographic functions was introduced since .NET Standard target1.3. To use the library, add
using System.Security.Cryptography
above the class. ECDiffieHellman is an abstract class, you can useECDiffieHellman.Create()
method to get the instance.Check the links:
https://xamarinhelp.com/cryptography-in-xamarin-forms/
https://stackoverflow.com/questions/41303777/use-ecdiffiehellman-with-or-without-cryptography-next-generation-cng
I have the exact same code and it is deployed in Android 5 - API 21 physical hardware and I am getting the error below. The target framework is .net Standard 2.1. Can you or someone try on their end to see if you are getting the same error ?
Xamarin 16.4.000.309 ([email protected])
Xamarin Designer 16.4.0.475 (remotes/origin/[email protected])
Xamarin.Android SDK 10.1.3.7 (d16-4/d66aed0)
ECDiffieHellman
is an abstract class try to create a custom class and make it inherit fromECDiffieHellman
class to use the method. The PublicKey should be specified a value which will be used by this ECDiffieHellman instance.Tutorial:
https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.ecdiffiehellman.publickey?view=netcore-3.1