Single payments

Your requests contains data and to ensure its authenticity, you are required to sign the requests while using Rabobank APIs.

Reference: Signature draft

Start with sandbox

We recommend that you first develop your application using the Sandbox environment in the Rabobank developer portal. Read Get Started to set up your account.

Get the signing certificate

Use either of the following certificates based on your API:

In case you don't yet have an official certificate, you can use an example certificate for Sandbox.

⤓ cert.pem ⤓ key.pem

👍

You can use these certificates to recreate the code example as shown below.

🚧

The signing certificate is sent with a signing request but not stored on the Rabobank developer portal. If you want to change/replace you can make changes on your own system.

You can also choose to have two valid certificates when allowed by your system.

Create the digest

The digest is a base64 encoded hash of the body, example: Base64(SHA512(body))

  1. Pass the body of your request (or an empty string if there is no body) through a hashing algorithm.
    📘

    We recommend using SHA 512 but you can also choose to use SHA 256

  2. Make sure the hashed output is Binary format.
  3. Base64-encode the output.
  4. Add the result to your digest header declaring the used hashing algorithm, i.e. (RSA-SHA512/RSA-SHA256).

Example digest header

Examples of the digest header for various APIs and their bodies using SHA-512:

PSD2 - Single Payment Initiation
{"creditorAccount":{"currency":"EUR","iban":"NL10RABO0123456789"},"creditorAddress":{"buildingNumber":"8","country":"NL","postcode":"2456RL","streetName":"Utrechtstraat","townName":"Utrecht"},"creditorAgent":"RABONL2U","creditorName":"Company","debtorAccount":{"currency":"EUR","iban":"NL10RABO0912345678"},"endToEndIdentification":"PI-123456789","instructedAmount":{"content":"10.25","currency":"EUR"},"remittanceInformationUnstructured":"Ref Number Merchant 235839479.3434","requestedExecutionDate":"2022-06-15"}
sha-512=97iSEKK+wtenUIu8DozlaGP+g2OjYy8F081o0gaLt4w6FomFJVEJktCPHEfrauwU48Tus44YStT8+q6erKA4Gg==
🚧

Due to security regulation, spaces or line breaks between JSON elements cause incorrect digest error.

Create the signing string

The signing string contains several headers separated by line breaks (\n).

👍

The order is not crucial, as long as you define them in the same order in the signature header.

Signing headers per API

ParameterRequiredRemark
dateYes–
digestYes–
x-request-idYes–
psu-idNoThis field should be included as a header of the HTTP request
tpp-redirect-uriNoMandatory for HTTP POST PSD2 - Single payments requests

Example signing string

Examples of the signing string:

PSD2 Single Payment Initiation
date: Thu, 24 May 2022 06:53:05 GMT
digest: sha-512=97iSEKK+wtenUIu8DozlaGP+g2OjYy8F081o0gaLt4w6FomFJVEJktCPHEfrauwU48Tus44YStT8+q6erKA4Gg==
x-request-id: 7d2da3f9-67d3-5034-b7cc-29f1a05ef1f5
tpp-redirect-uri: https://www.rabobank.nl

Sign using your Private key

The signature is the signing string signed with the private key: Base64(RSA-SHA512(signing_string))

  1. Create the signing string.
  2. Sign it using the hashing algorithm you used (RSA-SHA512/RSA-SHA256) and the private key of the signing certificate.
  3. Base64-encode the output.

Example signature

Examples of the signature:

PSD2 Single Payment Initiation
LW0sGv1Ptg8vTNVDzVCZv4l3TQSC565AMGlWOKNMAO7HorDeaswYhQO6Af0Y8fUmQsCRQOefC9JhjdXqjlJQXN7XYs2Zstg1FczWF4sExx2eAPquW5gwNyittSkg9Ln8wJ6/dnaZIa8KfzVWOH5wFPqb3mMmMn7RFAVpPp3hGEcrZAbTXglwyLTyr37/0beEBHC1sdjVkE+U6E7/lQs1IE0bgMS+qgIoncp+wVpELLg4FUe6CN5vC51exiud1sSxyScdNVbAhRK2XTgaxzQhN4VoYcztruxcyoVpYyK6sZK44lOO034i+HnUowrpTXV543p1u1O1q8Q4tnbQg+poYQ==

Create the Signature header

The signature header consists of the following components:

Component Example Description

keyId

$ openssl x509 -in cert.pem -noout -text

The serial number of the certificate as defined in the TPP-Signing-Certificate header. The format should be Integer not hex.

algorithm

rsa-sha512

Specify which algorithm was used when generating the signature:

  • rsa-sha512
  • rsa-sha256

headers

"date digest x-request-id"

The list of headers contained in the signature:

  • lowercase
  • separated by a space
  • in the same order as they have in the signing string

signature

The result created in step Sign using your Private key

Example signature header

The resulting signature header for our example:

PSD2 - Single Payment Initiation
Signature: keyId="1523433508",algorithm="rsa-sha512",headers="date digest x-request-id tpp-redirect-uri",signature="LW0sGv1Ptg8vTNVDzVCZv4l3TQSC565AMGlWOKNMAO7HorDeaswYhQO6Af0Y8fUmQsCRQOefC9JhjdXqjlJQXN7XYs2Zstg1FczWF4sExx2eAPquW5gwNyittSkg9Ln8wJ6/dnaZIa8KfzVWOH5wFPqb3mMmMn7RFAVpPp3hGEcrZAbTXglwyLTyr37/0beEBHC1sdjVkE+U6E7/lQs1IE0bgMS+qgIoncp+wVpELLg4FUe6CN5vC51exiud1sSxyScdNVbAhRK2XTgaxzQhN4VoYcztruxcyoVpYyK6sZK44lOO034i+HnUowrpTXV543p1u1O1q8Q4tnbQg+poYQ=="

Create a header containing the certificate

In order to verify your signature, you are required to send us a public certificate in a request header.

To do so:

  1. Strip the PEM certificate from its -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- tags.
  2. Remove all the line breaks.

Example

The result with our example certificate would be:

PSD2
TPP-Signature-Certificate: MIIDkDCCAnigAwIBAgIEWs3AJDANBgkqhkiG9w0BAQsFADCBiTELMAkGA1UEBhMCTkwxEDAOBgNVBAgMB1V0cmVjaHQxEDAOBgNVBAcMB1V0cmVjaHQxETAPBgNVBAoMCFJhYm9iYW5rMRwwGgYDVQQLDBNPbmxpbmUgVHJhbnNhY3Rpb25zMSUwIwYDVQQDDBxQU0QyIEFQSSBQSSBTZXJ2aWNlcyBTYW5kYm94MB4XDTE4MDQxMTA3NTgyOFoXDTIzMDQxMTA3NTgyOFowgYkxCzAJBgNVBAYTAk5MMRAwDgYDVQQIDAdVdHJlY2h0MRAwDgYDVQQHDAdVdHJlY2h0MREwDwYDVQQKDAhSYWJvYmFuazEcMBoGA1UECwwTT25saW5lIFRyYW5zYWN0aW9uczElMCMGA1UEAwwcUFNEMiBBUEkgUEkgU2VydmljZXMgU2FuZGJveDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANoAjqGWUgCIm2F+0sBSEwLal+T3u+uldLikpxHCB8iL1GD7FrRjcA+MVsxhvHly7vRsHK+tQyMSaeK782RHpY33qxPLc8LmoQLb2EuiQxXj9POYkYBQ74qkrZnvKVlR3WoyQWeDOXnSY2wbNFfkP8ET4ElwyuIIEriwYhab0OIrnnrO8X82/SPZxHwEd3aQjQ6uhiw8paDspJbS5WjEfuwY16KVVUYlhbtAwGjvc6aK0NBm+LH9fMLpAE6gfGZNy0gzMDorVNbkQK1IoAGD8p9ZHdB0F3FwkILEjUiQW6nK+/fKDNJ0TBbpgZUpY8bR460qzxKdeZ1yPDqX2Cjh6fkCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAYL4iD6noMJAt63kDED4RB2mII/lssvHhcxuDpOm3Ims9urubFWEpvV5TgIBAxy9PBinOdjhO1kGJJnYi7F1jv1qnZwTV1JhYbvxv3+vk0jaiu7Ew7G3ASlzruXyMhN6t6jk9MpaWGl5Uw1T+gNRUcWQRR44g3ahQRIS/UHkaV+vcpOa8j186/1X0ULHfbcVQk4LMmJeXqNs8sBAUdKU/c6ssvj8jfJ4SfrurcBhY5UBTOdQOXTPY85aU3iFloerx7Oi9EHewxInOrU5XzqqTz2AQPXezexVeAQxP27lzqCmYC7CFiam6QBr06VebkmnPLfs76n8CDc1cwE6gUl0rMA==

More information on signatures

See:

<https://tools.ietf.org/html/draft-cavage-http-signatures-10> <https://tools.ietf.org/html/rfc3230>