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

459 views Asked by At

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?

0

There are 0 answers