Lukas, thanks for the quick and detailed response!
When I run your code on a desktop VB.net program, it outputs a binary signature file with the correct number of bytes (yeah!), but when I run the verification routine it fails.
Do I need to run an ECC plugin for my desktop app?
Yes, my private key is an elliptic curve private key, it was created using this command:
openssl ecparam -out priv.pem -noout -name secp521r1 -genkey
I'm unsure if this is the same as a NIST P-521 curve key.
Note I'm using the Rebex.Security.dll (2017 trial), but the other Rebex dlls are from a purchased 2016 R3 release. I referenced the files in
C:\Program Files (x86)\Rebex Components 2016 R3\bin\net-2.0
Do all the dlls need to be from the same release?
Switching to my mobile app:
When run it displays "Elliptic curve algorithms need a plugin on this platform". It sounds like I didn't install the plugin correctly. Here's how I installed it:
- Downloaded the ECC plugins from your link
Added project references to
- netcf-2.0\Rebex.Castle.dll
- netcf-2.0\Rebex.Curve25519.dll
Copied these 2 dlls to mobile device's app folder, which already had Rebex.Sftp.dll, Rebex.Networking.dll, Rebex.Common.dll, Rebex.Security.dll (2017 trial) .
Note: the other Rebex dlls are from a purchased 2016 R3 release.
At the top of my app I import:
Imports Rebex.Security.Cryptography
Imports Rebex.Security.Cryptography.EllipticCurveAlgorithm
I don't know how to convert this sample C code on the plugin page to VB:
// import NIST and Brainpool curves
AsymmetricKeyAlgorithm.Register(EllipticCurveAlgorithm.Create);
I added this to CreateEncodedSignature():
AsymmetricKeyAlgorithm.Register(EllipticCurveAlgorithm.Create)
But this gives a compile error:
- error BC30455: Argument not specified for parameter 'algName' of 'Public Shared Function Create(algName As String) As Rebex.Security.Cryptography.EllipticCurveAlgorithm'.