I develop Xamarin.Forms Application and right now I'm debugging it on my Android device (it's 4.4 ver. of Android, if it matters). I need to use cryptography with ECDsa, so I've found that System.Security.Cryptography.Cng is needed for System.Security.Cryptography to support it. I've downloaded System.Security.Cryptography.Cng ver. 4.5.0 in Nuget Packages for all my projects. So I need to create a new pair of keys to sign some data, and when I try do it like this
var p = new CngKeyCreationParameters
{
ExportPolicy = CngExportPolicies.AllowPlaintextExport,
KeyCreationOptions = CngKeyCreationOptions.OverwriteExistingKey,
UIPolicy = new CngUIPolicy(CngUIProtectionLevels.ProtectKey, KeyName, null, null, null)
};
CngKey key = CngKey.Create(CngAlgorithm.ECDsa, keyAlias, p);
I get error "System.NotImplementedException: The method or operation is not implemented." I've tried like many algorithms for CngAlgorithm, parameters, but still have the same exception. So what I'm doing wrong? I know it can be something pretty silly, and really need help to find this. I've tried to find the same problems, but didn't get lucky. The only close question was: "The requested operation is not supported in CngKey.Create", but it didn't help.