ASN.1 Tools for C
The OSS® ASN.1 Tools for C is a complete development toolkit for rapidly building applications using ASN.1. This product features a powerful ASN.1:2015 capable compiler, a runtime library with ASN.1 BER, CER, DER, PER, OER, XER, CXER and E-XER encoder/decoder engines, and a rich collection of utilities to simplify and speed your development. The OSS ASN.1 Tools for C fully support 4G (LTE: RRC, S1, and X2 protocols).
The compiler takes ASN.1 specifications as input, and generates C language data structures plus control tables for encoding and decoding. The OSS compiler offers extensive diagnostic capabilities to minimize your development time and effort.
A set of runtime libraries provides ASN.1 encoding and decoding functions and valuable auxiliary functions to operate on application messages. The OSS runtime libraries have been ported to 500+ platforms, including many embedded platforms.
Support for JSON ER allows serializing ASN.1 data to the popular JSON format and converting between JSON messages and ASN.1 binary messages.
Support for OER allows working with ASN.1 binary messages that can be encoded/decoded significantly faster than BER and PER messages, while being only slightly less compact than PER messages.
Support for E-XER allows generation of XML compatible with output from XML Schema tools.
If you need high speed encoding/decoding and the smallest possible memory footprint, look no further. Simply put, the OSS ASN.1 Tools for C are the most optimized ASN.1 tools you will ever find.
ASN.1 Tools for C features
ASN.1/C Compiler
The ASN.1 compiler is a standalone program that takes one or more input files, where each input file contains one or more ASN.1 modules. The compiler verifies that the specification is valid, and generates:
(the Lean Encoder Decoder is provided in a separate package)
Cross compiling is supported by the ASN.1 Tools for C. Cross compiling enables a developer to produce files that can be used on a different operating system than the one the compiler runs on. Maximize your investment with the ability to cross-compile. Learn more about cross-compilation.
Encoder/Decoder
The OSS encoders/decoders provide, among many other features, the ossEncode() and ossDecode() functions. The ossEncode() function takes data placed by your application program in the compiler-generated C data structures and converts it to a string of bytes encoded according to BER, CER, PER, OER, DER, XER, CXER or E-XER.
The other function, ossDecode(), takes a string of bytes that have been encoded according to BER, CER, PER, OER, DER, XER, CXER or E-XER and performs the inverse operation of the encoder, resulting in a C data structure that you can easily manipulate.
TLV Print Utility
This utility, included with the ASN.1 Tools for C, takes a BER or DER encoding in ASCII or binary format from an input file and writes it to an output file in one of three different type-length-value (TLV) formats.
The space-optimized encoder/decoder (SOED) is so named because its emphasis is on minimizing use of memory, especially when the abstract syntax is large or complex. Both the encoder and decoder possess a simple yet flexible memory management interface as well as a wealth of tracing, error trapping, diagnostic and recovery capabilities.
The time-optimized encoder/decoder (TOED) has a program call interface identical to the space-optimized encoder/decoder's and performs the same function (except that it does not possess any tracing capability), but its emphasis is on minimizing CPU utilization.
The OSS runtime libraries have been ported to 500+ platforms, including many embedded platforms.
More functionality
Runtime functions, supporting PDU copying, comparing, printing and more, make your application development process easier.
Interpretive ASN.1 API
The Interpretive ASN.1 API (IAAPI), included at no extra cost in the ASN.1 Tools for C, can be used in conjunction with the regular ASN.1/C compiler (when the ASN.1 schema is compiled at the time when the application is developed), or with OSS' Compile-And-Go Library (CAGL) (when the schema is compiled dynamically at runtime).
IAAPI provides means to get information about the details of a compiled ASN.1 schema, including the types it defines (say, a record with multiple components), the fields of a type (say, an integer and a string) and the constraints associated with them (say, a smaller-than-10 integer). This information allows developers to write code that parses the content of a message, which is particularly useful when its structure is unknown at application development time. Similarly, developers can write code to create, field by field, a new message, so long as its format obeys the schema compiled.
IAAPI supports ASN.1 BER, CER, DER, PER, OER, XER, CXER and E-XER
Standards Conformance
This powerful software conforms fully to the ASN.1 standards listed below:
ASN.1 Tools for C — Runtime Choices
Throughout the years, OSS Nokalva's customers have had many different requirements for code size, encoding/decoding speed and diagnostic capabilities on various mainstream and embedded platforms. To satisfy our customers' various needs, OSS Nokalva offers our ASN.1 Tools for C runtime libraries in three flavors.
All three flavors of the runtime libraries perform the same function and have an identical API consisting of functions for encoding/decoding ASN.1 messages, functions for copying, comparing, printing, and freeing unencoded/decoded messages, a simple, yet flexible memory management interface, and many other useful functions.
You can change from using one flavor of the ASN.1/C runtime to using another with no impact to your application code. See the "ASN.1/C Runtime API" manual for detailed instructions on how to switch between the various runtime flavors.
SOED
The Space-Optimized Encoder/Decoder (SOED) was so named because of its emphasis on minimizing memory usage (i.e., small code size), especially when the ASN.1 specification is large or complex. SOED is a popular choice for use during development. It offers a wealth of tracing, error trapping, diagnostic and recovery capabilities, our most flexible memory manager, and the ability to work interactively with an ASN.1 specification (which is useful, for example, when you need to read information about the constraints of a particular ASN.1 type at runtime).
TOED
The time-optimized encoder/decoder (TOED) is a popular choice for deployment because of its emphasis on minimizing CPU utilization. We purposely minimized the tracing capability and used a code-driven rather than table-driven design to achieve lightning speed.
LED (packaged separately)
The lean encoder/decoder (LED) is optimized to offer a smaller code size than the SOED, yet fast encode/decode performance. It purposely does not possess a wealth of tracing and diagnostic capabilities. It is often the best choice for working with large ASN.1 specifications, particularly when your software runs on systems with significant memory constraints.
Which ASN.1/C Runtime is Right for Me?
Use the table below to choose the ASN.1/C runtime that best suits your needs, based on its performance (expressed as both code size and the speed of encoding) and diagnostic capabilities.
SOED |
TOED |
LED |
|
Encoding/Decoding Speed |
Fast |
Fastest |
Faster |
Code Size(1) |
Small |
Medium(2) |
Small(2) |
Diagnostic Capabilities |
Rich |
Reduced |
Reduced |
Ideal for Use During |
Development and Deployment |
Deployment |
Deployment |
Best Suited for |
|
|
|
Runtime Performance Comparison
The following charts depict runtime performance results based on several standard ASN.1 specifications to help you get a feel for the comparative performance (code size and time spent during encoding/decoding) of each of the ASN.1/C runtime flavors.
If you can't find your ASN.1 specification below, you can approximate the relative performance of SOED/TOED/LED based on the size of your specification and/or the encoding rule used.
Performance Comparison Methodology
The encoding/decoding times and executable sizes for all ASN.1 specifications are presented relative to the smallest ones (1x). The encoding/decoding time was averaged for several different messages and normalized based on the size of the messages. For both charts, an exponential scale was used. Smaller bars reflect better performance.
The same generic encoding/decoding application was used for all measurements. The size of the application object code was compared, which was obtained from C-compiling and linking the sources and the control table (if applicable) generated by the ASN.1 compiler, as well as the application code and the corresponding runtime libraries.
Feature | ASN.1/ C |
ASN.1/ C++ |
ASN.1/ C# |
ASN.1/ Java |
Support for OER |
![]() |
![]() |
![]() |
|
Speed. Don't settle for snail-paced ASN.1 tools. |
Fastest | Faster | Fast | Fast |
Support for encoder/decoder with debug and tracing capabilities (SOED). |
![]() |
![]() |
![]() |
|
Support for interpretive encoder/decoder designed for a small memory footprint (LED). |
![]() |
![]() |
![]() |
|
Support for compiler-generated encoder/decoder designed for speed (TOED). |
![]() |
![]() |
![]() |
|
Encoding to file or socket in a few lines of code |
![]() |
![]() |
![]() |
![]() |
Quality Tracing and Precise Error Messages |
![]() |
![]() |
![]() |
![]() |
Extensibility |
![]() |
![]() |
![]() |
![]() |
Relay Safe Mode |
![]() |
![]() |
![]() |
|
Parameterization |
![]() |
![]() |
![]() |
|
Compare and Copy Value |
![]() |
![]() |
![]() |
![]() |
Constraint Checking |
![]() |
![]() |
![]() |
![]() |
Large Values for All Encoding Rules |
![]() |
![]() |
![]() |
|
Change runtime options dynamically with ease |
![]() |
![]() |
![]() |
![]() |
Access to ASN.1 without foreknowledge of the data |
![]() |
![]() |
![]() |
|
Value Notation Format I/O |
![]() |
![]() |
![]() |
![]() |
Nesting limits |
![]() |
![]() |
![]() |
|
Support of J2ME CLDC 1.1 (Connected Limited Device Configuration) |
![]() |