How to sign an MDR file?

The MDR gateway of the Ministry of Finance requires submission of files in XML format with electronic signatures in XAdES format. This manual explains how to sign an MDR file using PEM-HEART Signature.

Software Update

You should always use PEM-HEART Signature in the latest version available. New versions include functionality extensions and bug fixes. From time to time, new versions also bring new, more secure settings or signature algorithms.

You can check the current version after starting the program. To do this, press the Settings and then Check for updates button

Jak sprawdzić aktualność programu PEM-HEART Signature

This manual is based on PEM-HEART Signature version 3.9.12.32.

Signing the first document

In order to sign the first document, prepare an MDR file in XML format, then start the PEM-HEART Signature program, select the Sign button and add a file to be signed.

Then check the signature options (Options key) for the selected file.

If the options are not as shown below, correct the settings. If Add timestamp is selected, you do not need to remove it. The Ministry of Finance also accepts time-stamped signatures.

Opcje dla podpisywania pliku MDR

The program will save the signature inside the XML structure, in the same file.

Adding subsequent signatures

To add subsequent signatures to the MDR file in XML format, start the PEM-HEART Signature program, select the Advanced features option, and then press the Add signature button.

Add the file to the list of signed files, then check the signature options (Options key) for the selected file.

If the selected signature options are not as shown below, correct the settings.

Opcje programu przy dodawaniu następnego podpisu do pliku MDR

The program will save the signature inside the XML structure, in the same file.

Signature verification (checking)

 

Signatures saved in the “XML enveloped” format cannot be recognized at a glance. The signature(s) are saved inside the file and the file format remains unchanged.

You can check if the XML file contains signatures by performing signature verification. To do this, run PEM-HEART Signature, then select Verify, add the XML file to the list and verify signatures.

Possible errors

If you try to sign a file that already contains one signature, PEM-HEART Signature will prompt an error as below:

Błąd przy próbie dodania następnego podpisu jako pierwszego

If such an error occurs, add the additional signature to the file using the Add Subsequent Signatures instruction (see above).