Signing a transaction with SSL
Bitcoin does not work with strings and hashing, you first need to convert to binary. On Unix systems, you can use xxd to convert string to binary (into file).

See also here:

Verifying a bitcoin trx on the Unix cmd line with OpenSSL?