Export / Integrity Check
Introduction
The Fiscal Archive must be created at least once a year and may not contain more than 365 days. If the POS System does not rely on the efsta Cloud for archiving, it must regularly create the archive itself and store it in a revision safe manner.
To access efsta documentation in French for exporting the data archived and checking its integrity follow this link.
Note that the POS System end-user is obliged to provide all fiscal archives of the last 7 years (the current fiscal year plus 6 past years). The POS System end-user must prove that the archives have not been changed and have also been stored in an audit-proof manner.
This obligation can be transferred to the POS System Creator if the POS System end-user does not have direct access to the archives. For example, the POS stores the archives in its own memory and only grants access via the user interface.
If the archives are stored locally on the POS, the POS System end-user is obliged to restore the entire system with a regular backup in case of failure, theft or similar.
Access to archived data via efsta Portal
Connection to efsta Portal
Depending if the archive obligation relies on the POS System Creator or the POS System end-user, connect to efsta Portal using the appropriate Username and Password or by using an existing Microsoft or Google account.
Selection in organizational structure
As archiving can be seen per Location or Cash register terminal (EFR), make the selection within the organizational structure in the left side menu.
Data Export
Data export: Location level
On the “Locations” page in the efsta portal, select the location for which you need the data export. Then click on in the location level. A properties window will open in which you must click on the "Data sharing" tab. There you can select a period and create the data release.
A link to exported data and a key to decrypt the exported data are then created.
Copy the password then click on the link to access data.
The download will start. Kindly note that depending on the volume of data to be exported this action can take several minutes. Do not put the tab with the download in the background as it might get into the « Eco mode » which then stops the download.
Download in process
Download finished
Once download is finished, select from the drop down menu the Download type: Fiscal FR = export.xml, the journal containing all proof able document and record types as XML file FR Grand Totals = total.xml, the journal containing all month and year signatures since start of recording (this data is never purged) as XML file FR Journal Archive - .json
Once download type selected in the drop down menu, past the previously copied password and click “OK”.
Downloaded files will be saved by default in “download” folder on local computer.
Data export: EFR level
Search in the efsta Portal under "Fiscal Register" for the EFR for which an export is required. click on – a properties window opens. In the properties window, select the "Data Sharing" tab. You can now select the period for which you want to create the export. On the “Fiscal Register” page in the efsta portal, select the EFR for which you need the data export. Then click on in the EFR level. A properties window will open in which you can select a period and create the data release.
A link to exported data and a key to decrypt the exported data are then created.
Copy the password then click on the link to access data.
The download will start. Kindly note that depending on the volume of data to be exported this action can take several minutes.
Download in process
Download finished
Once download finished, select from the drop down menu the Download type: Fiscal FR = export.xml, the journal containing all proofable document and record types as XML file FR Grand Totals = total.xml, the journal containing all month and year signatures since start of recording (this data is never purged) as XML file FR Journal Archive - .json
Once download type selected in the drop down menu, past the previously copied password and click “OK”.
Downloaded files will be saved by default in “download” folder on local computer.
Content of the export
- export.xml: the journal containing all proofable document and record types as XML file
- total.xml : the journal containing all month and year signatures since start of recording (this data is never purged) as XML file
- .json
- audit.csv: the journal containing audit events (JET) as CSV file
Detailed naming of data file item as well as coding values of the headings used can be found in Chapter Contents of exported files.
Access to archived data on local computer
To access data on EFR locally, use a browser interface to http://localhost:5618/control
Export fiscal data
To export the journal containing all proof able documents and record types as XML file select the period for which you want to create the export and click on “Commence”.
Downloaded files will be saved by default in “download” folder on local computer.
Export Grand totals
Click on “Commence” to export the journal containing all month and year signatures since start of recording (this data is never purged) as XML file.
Downloaded files will be saved by default in “download” folder on local computer.
Export audit events
Click on “Commence” to export the journal containing all month and year signatures since start of recording (this data is never purged) as CSV file.
Downloaded files will be saved by default in “download” folder on local computer.
Export fiscal data, grand totals and audit events as .zip
You also have the possibility to download fiscal data, grand totals and audit events as .zip. To do so, select the period for which you want to create the export and click on “Commence”.
Downloaded zip folder will be saved by default in “download” folder on local computer.
Content of the export
- export.xml: the journal containing all proof able document and record types as XML file
- total.xml : the journal containing all month and year signatures since start of recording (this data is never purged) as XML file
- audit.csv: the journal containing audit events (JET) as CSV file
- Jou zip folder:
- 0000.jou
- 0001.jou
- 0002.jou
- 0003.jou
The number of files depends on the amount of transactions made. EFR will include 1.000 transactions within one journal (*.jou) file then a new file will be created. In the example are three files with 1.000 transactions at each file and the last file will still store transactions. Detailed naming of data file item as well as coding values of the headings used can be found in Chapter Contents of exported files.
Integrity verification tool
Verification Tool "proof.js"
The EFR itself includes methods to check the integrity of the archive/journal. This tool "proof.js" can be copied from /ProgramData/EFR/app/FR/web/proof.js or downloaded from http://localhost:5618/control/proof.js or from efsta Cloud Portal or the check can be done directly at the EFR “controle” page.
It verifies the content of data export files by:
- verifying signatures
- checking the signature chain per DataType
- check file hash
To test the effectiveness of proof.js use a text editor to manipulate a signature value in the input file – proof.js will detect signature and file hash invalidity.
Proof.js error codes:
| Code | Severity | Description | Exit |
|---|---|---|---|
| #FILENAME | abort | Filename to be specified as start parameter | 2 |
| #OPEN | abort | Cannot open file specified | 3 |
| #FORMAT | error | Line is not a valid XML element | 1 |
| #ERROR | error | Unexpected runtime error | 1 |
| #ES256 | error | Incompatible input file (“alg“:“ES256“ expected) | 1 |
| #EC | error | Incompatible curve (NIST P-256 expected) | 1 |
| #CHAIN | error | “Payload“: predecessor signature mismatch | 1 |
| #CERTIFICATE | error | “_“:“certificate“ missing | 1 |
| #PAYLOAD | error | “Payload“: missing in line | 1 |
| #SIGNATURE | error | “Signature“: missing in line | 1 |
| #VERIFY | error | Line signature verification failed | 1 |
| #SIGN | error | “Signature“: invalid length (base64url 86 bytes) | 1 |
| !CONTINUED | warning | First “Payload”: with unknown predecessor signature | 0 |
Journal File Verification "proofjou.js"
This program is automatically contained in jou*.zip when an export of local journal archive is performed (alternatively run from …/ProgramData/EFR/app/FR/web) or when entering the EFR on localhost:5618/.
Checks performed on .jou files:
- file checksum
- structural integrity
- gap lessness of sequence number SQ
- signature chain per DT
- signature verification against fiscal.cer
- in –expert mode analysis of transaction amounts
- and gap lessness of TN, DN per DT
proofjou.js errors and warnings
Following errors (#...) and warnings (!...) may be reported:
| Code | Name | Description |
|---|---|---|
| #LIC | File checksum error | May be caused by exception during operation or modification |
| #PARSE | Data parsing error | May be caused by execption during |
| #AUDIT | Audit message | Important selfcheck event |
| !INCR | Number not incremental | Regarding SQ, TN or DN; possibility caused by operation exception |
| !DIFF | Recalculation difference | Within transaction or against GT |
| ?CONTINUED | Chain continuation | Signature chain continued from previous transaction |
| #CHAIN | Chain broken | Possibility transaction missing in signature chain |
| #FORMAT | Format error | Cannot verify signature |
| #VERIFY | Signature invalid | For payload given using fiscal.pem |
| #HASH | File modified | File content has been modified resulting in a hash mismatch |
Program exit code is 1 in case of errors.
How to check integrity of exported data
- Download the file(s) to check by selecting the right download type and the right time range
- Select one of the proof methods you want to use. Recommendation here is to use the localhost method when using a system where you can access EFR and where you can see the webpage. Most Linux systems do not provide access to that screen, so therefore the download of the proof.js would be the better solution. After the download a readme.txt file will be within the download packet, please read this file first, it contains the manual of checking files.
- Method with EFR screen described
-
Local export from EFR
- Open any internet browser and access EFR (http://localhost:5618)
- Download the export.xml file
- In the line xml proof – add the downloaded file and click on “verifier”
- The result of the check will be seen right after the check
-
Export from the efsta Cloud
- Open any internet browser and access the efsta Portal
- Select the EFR where you have to provide the data as mentioned above as well as the proof.js file that is also provided at the exports
- Download the export.xml file and proof.js (from the efsta cloud or from local EFR) by downloading the “FR Journal archive” you get additionally the possibility to download the readme.txt for explanation by downloading the “FR Grand Totals” and/or “FR Fiscal” the proof.js can be downloaded as it can check both files.
- Depending on the operating system you might need the proof.js file (if node modules are not installed locally).
- Open command (cmd) and enter the installation path ot the node installation (like node.exe) then the proof.js and the path of the file that should get checked. Example:
C:\Users\efsta\Desktop\Test FR>C:\ProgramData\EFR\app\node.exe proof.js total_001_1.xml
If node modules are already installed, it would be enough to enterC:\Users\efsta\Desktop\Test FR>node proof.js total_001_1.xml - The result of the check will be seen right after the check
-
Contents of exported files
export.xml
Example export.xml:
Record Types and Fields:
| Type | Field | Description |
|---|---|---|
| source | File created by… | |
| format | “export“ | |
| name | Generator program name (“EFR“=efsta Fiscal Recorder) | |
| version | Program version | |
| issuer | System id | |
| EFR | Unique EFR id | |
| RN | Register Number (for multiclient EFR, “def” by default) | |
| time | Time of generation | |
| D | Date/time | |
| Time offset | In Online mode offset to cloud time (ms) | |
| cert | Local signing certificate | |
| alg | JWT hash and signature algorithm according to RFC7519 “ES256” required | |
| Public Key | Signature public key | |
| cfg | Sales header (cf Header and Issuer Data) | |
| fis | Fiscal record | |
| SQ | Journal SeQence number | |
| DT | Document Type | |
| Payload | Signature payload | |
| Signature | Signature (base64url) | |
| Per | For month/year grand totals | |
| signature | File signature | |
| Payload | File data hash up to this line (sha256 base 64) Canonicalization: all characters except \r and \n, plain ASCII | |
| Signature | Signature (base64url) | |
| Readme | Textual description how to proof the file | |
| info | Text line |
Tables of data recorded, archived, secured and restored
Header and Issuer Data
| Field | ESR references |
|---|---|
| Unique document identifier in Database | ESR.TL/TT/TN |
| Unique document number | ESR.DN |
| Software version | Cfg.Trm.Version |
| Number of prints | persisted in dat/reprint.dat |
| Name of the issuer | Cfg.Cmp.Nam |
| Issuer's address | Cfg.Loc.Adr |
| Postcode of the issuer | Cfg.Loc.Zip |
| City of the issuer | Cfg.Loc.City |
| Country of the issuer | Cfg.Cmp.Ctry |
| Siret (France: institution number, 14 digits) | Cfg.Loc.FR_SIR |
| Code NAF / APE (France: 5 characters, 1 letter + 4 digits) | Cfg.Cmp.FR_NAF |
| Legal Form | Cfg.Cmp.FR_TYPE |
| Social Capital | Cfg.Cmp.FR_CAPITAL |
| Issuer’s RCS | Cfg.Cmp.FR_RCS |