Skip to main content
This page sets up payment-order signing in the Pix plugin (the rail). It is optional. You need it only if payment-order signature is enabled for your institution at JD, as defined in JD’s JDPI manual (security mechanisms). Confirm this with JD. Without the signing values, nothing changes.

Set up signing

1

Create the key and the certificate

Choose the algorithm. Use the default unless you have a reason to change it.Create one key pair for your institution. It signs every payment order sent through your JD connection, including those of the indirect participants you host. A self-signed certificate is accepted. Run the block for your algorithm. Each block writes the private key to payment-signing.key and the certificate to payment-signing.crt.
The rail reads a private key in PKCS#8, SEC 1, or PKCS#1 format. The commands above write PKCS#8. The key type must agree with the algorithm.Before you register the certificate, make sure that the private key is the key of the certificate:
If the output is the key does NOT match the certificate, the key and the certificate do not agree, or a file cannot be read. Create the pair again. The rail refuses a pair that does not agree with 409 PIX-0136, before it calls JD.
2

Register the certificate at JD

The Pix plugin signs each payment order. For JD to accept it, JD must know your certificate: register it in JDPI Cabine. Upload only the certificate, which is public. Never upload or send the private key: it goes only to the Pix plugin.
  1. In JDPI Cabine, open Gestão de Certificados.
  2. Click Incluir.
  3. In Tipo Certificado, select Certificados Hash – Assinatura Payload.
  4. Upload payment-signing.crt.
  5. Write down the thumbprint that JDPI Cabine shows for the certificate.
Give the Pix plugin the same certificate in step 4. More than one certificate can be active at the same time, which lets you replace a key with no interruption. See Replace the key.
3

Check the thumbprint

Make sure that the certificate that you give to the rail is the one registered in JDPI Cabine. Calculate its thumbprint:
The output has the form sha1 Fingerprint=40:C0:3F:.... Remove the colons. The result must be the same as the thumbprint in JDPI Cabine. To get the value without colons directly:
4

Configure the Pix plugin

The configuration has three values. Set the key and the certificate together, or neither. With only one of them, the rail refuses each payment to another institution with 409 PIX-0136. A PEM value can have real line breaks, or be on one line with a literal \n at each line break.
Set the three environment variables on the API. All three are optional. The worker does not send payment orders, so it does not need them.Keep the private key in a secret, never in plain configuration.The values take effect when the API starts.
5

Confirm that it works

Send a Pix to another institution. Make sure that it settles. If the payment is refused or ends in ERROR, see If something fails.

If something fails

In each case, the rail releases the amount that it reserved, and no money moves. The rail does not send the refused order again. 409 PIX-0136 refuses only payment orders. The other JD calls, such as DICT and QR codes, continue to work.

Replace the key

JDPI Cabine accepts more than one active certificate. Replace the key in this sequence, so that no order goes out with a certificate that JD does not know:
  1. Create a new key and a new certificate.
  2. Register the new certificate in JDPI Cabine. Keep the old certificate active.
  3. Give the new key and the new certificate to the rail. On a Lerian-hosted deployment, give them to Lerian.
  4. Wait until the change takes effect. On a self-hosted deployment, restart every running API instance, so none keeps signing with the old key. On a Lerian-hosted deployment, wait until Lerian confirms the change.
  5. Send a Pix to another institution. Make sure that it settles.
  6. Wait until every Pix sent before the change has a final status.
  7. Delete the old certificate from JDPI Cabine.