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

Sk 66 Reputation points
2024-05-20T07:15:52.04+00:00

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))
            {
                sftp.Connect();

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

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…} 

Developer technologies | .NET | Xamarin
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2024-05-20T21:17:05.68+00:00

    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.

    https://github.com/sshnet/SSH.NET


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.