Unofficial C# Otto download demo
An example of the Otto library implementation in C#.
Warning
This demo is not intended for productive usage.
ELSTER introduced a library called Otto, designed for downloading objects from OTTER (Object Storage in ELSTER). As of June 9th, 2025, the only supported version of ERiC-Datenabholung is v31. Part of the retrieval process is downloading data from the OTTER servers, which can be done with Otto.
Most software developers using ERiC-Datenabholung need to implement Otto in their productive systems.
This demo intends to reduce implementation time.
./csotto
-u objectUuid UUID of object to download (mandatory)
-m size Allocate provided Bytes of memory and download object in-memory (optional, max: 10485760 Bytes), cf. Download modes
-e extension Set filename extension of downloaded content [default: "txt"]
-p password Password for certificate [default: "123456"]
-y proxy Proxy URL for communucation with the OTTER server (optional, by default no proxy is being set within Otto)
-f Force file overwriting [default: false]Examples:
csotto -u 468a69d4-0151-4681-9e8d-fcd87873d550 # ELOProtokoll / Lohnersatzleistung
csotto -u c48737b3-adfe-4e87-925c-7c362e00a416 -e pdf # DivaBescheidEStNote
The code and scripts have been tested on Linux, macOS and Windows.
Tip
A list of object UUIDs is available with test certificates. You can get a list of them using PostfachAnfrage with the test certificate. The examples above are for test-softorg-pse.pfx and might be removed from the test instance after the time specified in the metadata.
You need the official ELSTER Otto library. Download the ERiC package >= v42.1 for your platform from the ELSTER developer area, unzip it and place it at a desired path. Feel free to place it in ./vendor/. You need two libraries: otto and eSigner (platform dependent naming: (lib)otto.{so|dylib|dll} and (lib)eSigner.{so|dylib|dll}).
Note
The ERiC package, especially the included there libraries are subject to a separate license agreement (presented before download in the ELSTER developer area and included in the ERiC package itself).
Tip
Choose the right library for the platform you compile and run on. Recommended Otto version to use: 42.1 with eSigner 62.0.0.5
You can build the code with Docker using:
make docker-buildTip
Place the Otto library in ./vendor/. You could provide alternatively LD_LIBRARY_PATH environment variable on Linux or DYLD_LIBRARY_PATH on macOS during runtime.
Build with a tool of your choice and set up the project accordingly. Just don't forget to place the otto library where the build solution can find it. For example PATH, typical places where libraries are searched on your system or just place it next to the build executable.
Here is an example howto run csotto locally on macOS after installing .NET SDK 8.0.
# Clone repository
git clone [email protected]:rechtlogisch/csotto.git
# Change to directory with source code
cd csotto
# Retrieve test certificate to "certificate" subdirectory
./get-test-certificate.sh
# Build with dotnet
dotnet build
# Run `csotto`, provide objectUuid with -u option, DYLD_LIBRARY_PATH pointing to `otto` library and your DEVELOPER_ID inline
DYLD_LIBRARY_PATH="./vendor" DEVELOPER_ID="00000" dotnet run -u 468a69d4-0151-4681-9e8d-fcd87873d550Note
You should set your five-digit Developer-ID (German: Hersteller-ID) as the environment variable DEVELOPER_ID. You could source it from for example .env or pass it inline to csotto, as shown in the steps above.
Tip
The downloaded result will be saved in the same directory as csotto, unless you provide a different PATH_DOWNLOAD.
All supported environment variables are listed in .env.example. Feel free to copy them to .env, adjust accordingly and source for usage.
Some Otto settings within this demo can be configured with environment variables. Others can be set in an otto.ini file placed next to the otto library. See otto.ini-dist for a list of all currently known Otto settings. They are described in the chapter 4.1.4 of ERiC-Entwicklerhandbuch.pdf inside official documentation of the ERiC package.
The demo showcases two methods for downloading objects: blockwise (default) and in-memory. OTTER and Otto operate by design by streaming data and forwarding it to the desired storage blockwise. That is the optimal and memory-efficient way for large files. ELSTER engineers wrapped all the necessary calls and the download workflow in one function: OttoDatenAbholen(), which simplifies the implementation and temporarily stores the complete object in memory.
This demo can operate in both modes. To download in-memory, add the option -m with a value exceeding 0 and not exceeding 10485760 Bytes (10 MiB). It is recommended to use the in-memory mode with objects where the final size is known and does not exceed the arbitrarily set size of 10.485.760 Bytes.
Important
-m sets the minimal allocated memory size. When the object is larger than the set size, Otto allocates as much as needed and as much as available memory. Use at your own risk.
A simple Dockerfile is included. You can use make docker-build and make docker-csotto to build and run csotto in a container.
Tip
Mount volumes, set PATH_DOWNLOAD and PATH_LOG environment variables to expose data outside the container.
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
The ERiC package, especially libraries, is not included in this repository and is subject to a separate license agreement. Please see the ELSTER developer area or the lizenz.pdf included in the ERiC package for more information.
This demo was developed by RL Recht logisch GmbH & Co. KG and should be used only for test purposes.
ELSTER is a registered trademark of the Freistaat Bayern, represented by the Bayerische Staatsministerium der Finanzen.