Signature is the signed String created at the previous step

Sign with RSA (rsa-sha256) algorithm the previously created String with your private key, using Base64 as output.

(request-target): post /wally-services/protocol/tests/signature
date: Mon, 18 Mar 2019 15:10:24 +0000
digest: SHA-256=ZML76UQPYzw5yDTmhySnU1S8nmqGde/jhqOG5rpfVSI=


Do not encrypt but sign

Please note that the String must be signed, not encrypted

Code sample 3/4

# In this example private key is storend in "private.pem" file

BODY="{\n  \"flow\": \"MATCH_CODE\",\n  \"amount_unit\": 100,\n  \"currency\": \"EUR\"\n}"

DIGEST="SHA-256="$(echo -e "$BODY\c" | openssl dgst -sha256 -binary | base64)

STRING="(request-target): post /wally-services/protocol/tests/signature\nhost:\ndate: Mon, 18 Mar 2019 15:10:24 +0000\ndigest: $DIGEST"

SIGNATURE=$(echo -e "$STRING\c" | openssl dgst -sign private.pem -sha256 -binary | base64)
$privateKey = "Your RSA Private Key";

$body = "{
  \"flow\": \"MATCH_CODE\",
  \"amount_unit\": 100,
  \"currency\": \"EUR\"

$digest = "SHA-256=".base64_encode(hash("sha256", $body, true));

$string = "(request-target): post /wally-services/protocol/tests/signature
date: Mon, 18 Mar 2019 15:10:24 +0000
digest: $digest";

openssl_sign($string, $signatureRaw, $privateKey, OPENSSL_ALGO_SHA256);
$signature = base64_encode($signatureRaw);
const crypto = require('crypto')

const privateKey = 'Your RSA Private Key'

const body = `{
  "flow": "MATCH_CODE",
  "amount_unit": 100,
  "currency": "EUR"

const digest = `SHA-256=`.concat(crypto.createHash('sha256').update(body).digest('base64'))

const string = `(request-target): post /wally-services/protocol/tests/signature
date: Mon, 18 Mar 2019 15:10:24 +0000
digest: ${digest}`

const signature = crypto.createSign('RSA-SHA256').update(string).sign(privateKey, 'base64')

Signature checker

Tool that allow to check the Signature created. Output must be the same.