I'm trying to sign a transaction using SSL. I already generated the raw transaction and hashed it properly. So I'd like to sign the following hash: c88568c9a85d52d07432dee9ee8dd1c63a4bfea6f754d2ec94f50015ae91a3f3, using the following private key: a16173978f25fcae5a1e55733fbda2f86470427e5cd9407c51b427c3054d182e.

I have looked around and figured the following command: openssl dgst -sha256 -hex -sign key.pem hash.txt. Great! (I think). How can I convert my private key to .pem file so SSL can use it to sign?


1 Answer 1


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?

Not the answer you're looking for? Browse other questions tagged or ask your own question.