The Interpretive ASN.1 API

Applies to: ASN.1/C 10.5

The Interpretive ASN.1 API (IAAPI) enables applications to create and encode data described by ASN.1 structures without any prior knowledge of the original ASN.1 specification (for example, the number of components and their base types). Messages (PDUs) can be decoded and their components can be individually accessed and modified from an easy-to-use interface.

The IAAPI is available on common platforms (Windows, Linux, and Solaris, for example). For more information about installing the IAAPI on your platform, contact Sales ‹›.

Getting Started

To use the IAAPI, link your application code with the IAAPI function library. For more information about the filename of the library for your platform, see the Getting Started section.

To take full advantage of the IAAPI routines, specify the -per, -ber, and -valueRefs compiler command-line options. Also, make sure you do not specify the -noDebug and –noConstraints compiler command-line options.

Note that IAAPI functions are not supported for the time-optimized encoder/decoder library (TOED).

Most embedded system shipments of the OSS ASN.1 Tools for C do not include the IAAPI library. Check your lib/ directory to and see if yours has one.

The first argument to all API functions is a pointer of type OssGlobal. This structure is the same as the one passed to all other OSS API functions and contains information about the OSS run-time environment that should be retained from one function call to the next. It must be allocated and initialized by a call to the ossinit() function (or ossWinit() on Windows) before being passed to any other OSS function. When the application finalizes all calls to the IAAPI functions, free up system resources reserved by the IAAPI by calling either ossTermIAAPI() or ossterm() (or ossWterm()).

Before using the IAAPI functions, follow these steps:

  1. Specify the IAAPI static library (iaapi.lib, for example), import library (iaapid.lib, for example), or dynamic library (, for example) file on your linker's command-line before the encoder/decoder library file that you use.
  2. Add the ossiaapi.h header file to your list of included files. For example:
    #include <stdio.h> 
    #include "asn1data.h" /* compiler-generated header file */ 
    #include "ossiaapi.h".
  3. Compile your ASN.1 specifications with the -valueRefs compiler option. The option instructs the compiler to generate value reference information into the control table used by certain IAAPI functions.

Sample programs that illustrate the use of the IAAPI are available in the samples/iaapi directory of the OSS ASN.1 Tools package. For more information, see the samples/iaapi/README.TXT file.

Using the IAAPI

The IAAPI is intended for advanced users who are already familiar with the Core-essential API and want to understand the low-level details of the input ASN.1 specification during runtime; for most users, the Core-essential API functions should be sufficient to directly access the ASN.1-compiler generated data structures.

The IAAPI library functions help you learn about the structure of the ASN.1 data used by your application and allow you to modify and add values for these pre-existing structures. This is especially useful when writing your application program without prior knowledge of the exact ASN.1 specification in use or if you would not want to correlate the advanced data structures generated by the ASN.1 compiler with the original ones present in the ASN.1 specification.

The IAAPI is used with both the standard OSS ASN.1 Tools and the add-on Compile-And-Go-Library (CAGL); the latter allows you to dynamically modify the structure of the ASN.1 specification in use.

This documentation applies to the latest version of the OSS® ASN.1 Tools for C. If you are using an earlier version, consult the documentation that was shipped with your product.

Copyright © 2017 OSS Nokalva, Inc. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means electronic, mechanical, photocopying, recording or otherwise, without the prior permission of OSS Nokalva, Inc.
Every distributed copy of the OSS® ASN.1 Tools for C is associated with a specific license and related unique license number. That license determines, among other things, what functions of the OSS ASN.1 Tools for C are available to you.