Set up signing
1
Create the key and the certificate
Choose the algorithm. Use the default unless you have a reason to change it.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
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.- ECDSA P-256 (default)
- ECDSA P-384
- RSA 3072
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.
- In JDPI Cabine, open Gestão de Certificados.
- Click Incluir.
- In Tipo Certificado, select Certificados Hash – Assinatura Payload.
- Upload
payment-signing.crt. - Write down the thumbprint that JDPI Cabine shows for the certificate.
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.- Self-hosted (single-tenant)
- Lerian-hosted
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:- Create a new key and a new certificate.
- Register the new certificate in JDPI Cabine. Keep the old certificate active.
- Give the new key and the new certificate to the rail. On a Lerian-hosted deployment, give them to Lerian.
- 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.
- Send a Pix to another institution. Make sure that it settles.
- Wait until every Pix sent before the change has a final status.
- Delete the old certificate from JDPI Cabine.
Related pages
- Environment variables
- Setting up the rail
- To deploy the plugin, see the plugin-br-pix-jd chart README.

