System.Security.Cryptography.ECDsa.Create (System.Security.Cryptography.ECParameters parameters exception

Sk 61 Reputation points

We have integrated SSH.Net 2024.0.0 from Nuget for Xamarin UWP, Xamarin. IOS and Mono Android. UWP works fine. BUT iOS and Android are throwing exceptions. Any ideas or suggestions would be helpful. Visual Studio 2022 C#

          using (SftpClient sftp = new SftpClient(host, port, user, pass))

                if (!sftp.Exists(path))
                    ok = false;

Throws an Exception on sftp.Connect().

iOS Exception {System.NotImplementedException: The method or operation is not implemented. at System.Security.Cryptography.ECDsa.Create (System.Security.Cryptography.ECParameters parameters) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamari…} 

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,312 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce ( 59,036 Reputation points

    the System.Security.Cryptography.ECDsa methods are not supported on IOS or Android. a replacement cryptography library is required. I don't believe SSH.Net supports external encryption libraries. you will need to use a different SSH library or fork it and change the Cryptography to a supported one.