1 year ago

#9849

test-img

meg1311

'Operation is not supported on this platform' when converting ECDH public key to byte array

I have a client application which can be used from both windows and mac os. The application is using ECDH P-384 for key generation. I have below lines of code:

var client = ECDiffieHellman.Create(ECCurve.NamedCurves.nistP384);
var _publicKey = client.PublicKey.ToByteArray();

I am getting

"Operation is not supported on this platform"

in client.PublicKey.ToByteArray(); at runtime on macos. This works fine on windows os. The target framework is netcore 3.1 . Also the client is a powershell module and I tried this on powershell 7.1 and powershell 7.2. Am I missing anything for macos in my implementation?

c#

powershell

.net-core

cryptography

ecdh

0 Answers

Your Answer

Accepted video resources