#eric #bindings #tax #accounting #taxes #bindings-generator

sys eric-bindings

Rust bindings for the ELSTER Rich Client (ERiC)

7 unstable releases (3 breaking)

0.4.1 Aug 7, 2024
0.4.0 Aug 7, 2024
0.3.0 Aug 5, 2024
0.2.0 Aug 4, 2024
0.1.2 Aug 3, 2024

#6 in #tax


Used in eric-sdk

Apache-2.0

605KB
10K SLoC

Eric

latest version documentation latest version documentation build status

Rust bindings and SDK for the ELSTER Rich Client (ERiC)

What is ELSTER?

Elster (short for Elektronische Steuererklärung) is a project by the German tax administrations to process tax returns and declarations.

What is ERiC?

ERiC is a shared C library that is integrated into a tax application. ERiC checks the data supplied by the tax application for plausibility, and transmits the data encrypted to the computing center of the respective tax administration.

Requirements

You need to have the shared library libericapi.so and the header file ericapi.h available on your system which can be downloaded from ELSTER for developers after access has been requested here.

For generating the bindings on your platform and architecture, you need libclang as well. For example, on Debian/Ubuntu install:

apt install llvm-dev libclang-dev clang

Rust bindings

Generate bindings

To generate the bindings, eric-bindings expects the environment variables LIBRARY_NAME, LIBRARY_PATH, HEADER_FILE, and PLUGIN_PATH. For example:

PATH_VENDOR="ERiC-40.2.10.0-Linux-x86_64/ERiC-40.2.10.0/Linux-x86_64"
LIBRARY_NAME=ericapi
LIBRARY_PATH="$PATH_VENDOR/lib"
HEADER_FILE="$PATH_VENDOR/include/ericapi.h"
PLUGIN_PATH="$PATH_VENDOR/lib/plugins2"

The bindings have to be generated on-the-fly for your specific platform and architecture:

cargo build -p eric-bindings

The bindings are generated in target/debug/build/eric-bindings-<random-id>/out/bindings.rs.

Test bindings

The bindings are included in src/lib.rs via include! macro and tested by:

cargo test -p eric-bindings --lib

Logs are written to eric.log in the current directory.

Eric SDK

eric-sdk supports single-threaded Eric instances.

Usage

To use eric-sdk, add the path of the shared C library (e.g. to LD_LIBRARY_PATH on Linux).

To send the xml file, the path and password of the Elster certificate has to be provided via environment variables CERTIFICATE_PATH and CERTIFICATE_PASSWORD.

Supported Eric versions

Rust SDK Eric
0.1.0 38.1.6.0
0.2.0 39.6.4.0
0.3.0 40.1.8.0

Test SDK

# Run unit tests
cargo test -p eric-sdk -- --test-threads=1

# Run integration tests
cargo test -p eric-sdk --test '*' -- --test-threads=1

# Run external tests
cargo test -p eric-sdk --test '*' --features external-test -- --test-threads=1

Changelog

The eric-rs repository contains multiple crates with separate changelogs:

Dependencies

~105–260KB