The ASN.1 compiler (from ASN.1 to C++) & runtime (BER / DER)
A compiler from ASN.1 to C++ code and run-time library for encoding/decoding data using BER/DER.
Run-time library can be used independently from ASN.1 compiler.
The top directory consists of these sub-directories:
The Java ASN.1 to C++ compiler depends on JavaCC ASN.1 grammar,
this grammar is a bit modified comparing to original one. It is far from complete (e.g. does not
parse Information objects). However, ASN.1 compiler generates C++ code using that grammar.
An experimental Antlr4 ASN.1 grammar
with partial support of notations from X.680, X.681, X.682 and X.683 is available as an option of
ASN.1 compiler. Right now, compiler does not produce any C++ code if you this grammar is selected.
Several ASN.1 files and generated C++ code is available for protocols:
The runtime library uses CMake to build itself. As a result of compilation
static and shared libraries will be produced.
mkdir build
;cd build
;cmake ..
;make
;Unit tests can be built during library compilation, if CMake command line contains option-DBUILD_UNIT_TESTS=1
. Unit tests require Boost test framework, on Windows set environment
variable BOOST_ROOT equal to your Boost installation path (e.g. BOOST_ROOT=”c:\boost_1_55_0”).
Coverage data can be calculated, if CMake command line contains option -DDO_COVERAGE=1
. There
is no need to specify -DBUILD_UNIT_TESTS=1
if you are going to see coverage data, because it
will be enabled automatically. For example, to compile unit tests and collect coverage data
during their running, execute cmake -DDO_COVERAGE=1 ..
instead of command in step 4 above.
To run unit tests execute command: ./tests/TestBER
.
compiler
directorymvn package
target
directory if no errorsjava -jar asn1-compiler-<...>.jar
and follow on-screen instructionsThe runtime library uses CPack (feature of CMake) to generate an installable Debian package. If
compilation of runtime library was successful, execute make package
to create package.
If this project helped you, please, consider to make a donation.