ASN1C icon ASN1C ASN.1 Compiler

The ASN1C ASN.1 compiler translates ASN.1 and/or XML schema (XSD) source specifications into C, C++, C#, Java, Python, or Go source code. Developers can use this code to translate structures/objects to and from finished ASN.1 messages using ITU-T/ISO encoding rules BER, CER, DER, OER, PER, UPER, JER(JSON), or XER(XML). ASN1C also includes tools for converting XSD specifications to ASN.1 specifications and vice versa.

ASN.1 compiler

ASN1C generated code consists of type definitions and encode/decode functions (or methods) that provide a complete Application Programming Interface (API) for working with the message definitions contained within an ASN.1 specification.

In addition to the ASN.1 compiler, a run-time library of common encode/decode functions is also part of the package. This library contains routines to encode and decode ASN.1 primitives (BOOLEAN, INTEGER, etc.). The ASN1C ASN.1 compiler assembles a series of calls to these functions to accomplish the encoding or decoding of more complex message types.

All that a programmer needs to do to get an encoder/decoder up and running is to:

  1. Run ASN1C to generate code for a given ASN.1 or XSD specification,
  2. Develop an application to call functions/methods within the generated code,
  3. Compile/link the application, generated code, and run-time libraries.

To assist with items 2 and 3, the compiler also has the capability to generate sample reader and writer programs as well as a makefile to build all of the generated code.

ASN.1 to Source Code

Further details on the source code generation capabilities of ASN1C for specific languages can be found at the following links:

ASN.1 to C/C++

ASN.1 to Java

ASN.1 to C#

ASN.1 to Python

ASN.1 to Go


Download button

ASN.1 Eclipse Plugin

The ASN1C Eclipse plugin allows editing, syntax checking and code generation of source code within the Eclipse IDE environment using ASN1C. Read more..