<p>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).</p>

<p>See also here:</p>

<p><a href="https://bitcoin.stackexchange.com/questions/46455/verifying-a-bitcoin-trx-on-the-unix-cmd-line-with-openssl">Verifying a bitcoin trx on the Unix cmd line with OpenSSL?</a></p>

CC BY-SA 3.0
2017-12-25T16:03:41.943Z
2017-12-25T16:08:45.333Z
2017-12-25T16:08:45.333Z
pebwindkraft
<p>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: <code>c88568c9a85d52d07432dee9ee8dd1c63a4bfea6f754d2ec94f50015ae91a3f3</code>, using the following private key: <code>a16173978f25fcae5a1e55733fbda2f86470427e5cd9407c51b427c3054d182e</code>.</p>

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

<transactions><ssl>
Signing a transaction with SSL
user2298995
# Signing a transaction with SSL

(Asked by: username_0 on 2017-12-25)

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?

**Tags:** transactions, ssl


---

## 1 answers

### Answer by username_1 on 2017-12-25. Score: 0

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?](https://bitcoin.stackexchange.com/questions/46455/verifying-a-bitcoin-trx-on-the-unix-cmd-line-with-openssl)


---

