I am building a license generator for nodejs and I am currently testing on Heroku.
On my local machine running OpenSSL 1.0.1g, I'm able to test my key pairs (sign and verify) like this:
# data.txt's content (the content of the string literal): "Tsenkov" openssl dgst -sha1 -sign private.pem data.txt > license.txt openssl dgst -verify public.pem -signature license.txt data.txt
But on Heroku (OpenSSL 0.9.8) I get the following error:
Error Signing Data 27:error:0606B06E:digital envelope routines:EVP_SignFinal:wrong public key type:p_sign.c:99:
Here's how my pair is generated:
openssl ecparam -genkey -name secp521r1 -noout -out private.pem openssl ec -in private.pem -pubout -outform PEM -out public.pem
I remember having the same problem on OS X 10.9.2 (local machine), but before trying anything else, I updated OpenSSL through Homebrew and it miraculously started working.
I guess there's an older way of signing data (syntax, etc.) which I'm not aware of.
Can someone help? Thanks.