What's New in the OSS ASN.1 Tools for Java

Applies to: ASN.1/Java 7.1

What's New in ASN.1/Java 7.1

New Features


JSON Encoding Rules support in the ASN.1/Java compiler and the SOED, TOED, and LED runtime libraries now conforms to Draft ITU-T Recommendation X.jsoner. The existing -json command-line option now instructs the compiler to enable support for X.jsoner at runtime.

The JSON codec now supports encoding instructions, specified by Draft ITU-T Recommendation X.jsoner in the SOED and TOED. The following encoding instructions are supported:

  • JER:BASE64
New samples

Samples for the following LTE protocols have been created:

  • LTE LCS Application Protocol (LCS-AP) - TS 29.171 V13.2.0 (2016-03)
  • LTE Positioning Protocol A (LPPa) - TS 36.455 V13.1.0 (2016-03)
  • LTE RRC protocol to demonstrate cV2X features - TS 36.331 V14.2.2 (2017-03)


The compiler will no longer issue a false warning for a valid type value constrained by inner subtype constraints. Also, the SOED runtime constraint checker will no longer issue false validation errors for such values.

The TOED compiler now generates a correct constraint checker for a SEQUENCE or SET type where some fields have DEFAULT values. Previously, if the value of the field was not explicitly specified, a NullPointerException could be thrown. Now, the generated code attempts to validate the implied value.

Previously, the SOED runtime constraint checker omitted any validation of a SEQUENCE or SET component when it had a DEFAULT value and the component's value was not explicitly specified. Now, the constraint checker validates such components using their DEFAULT value instead.

The SOED CER encoder will now relay an unknown extension of ENUMERATED and will not issue this confusing error message: E0124S: Unable to relay unknown extension: the extension was decoded by the Canonical Encoding Rules (CER) Coder but is relayed by the Canonical Encoding Rules (CER) Coder.

What's New in ASN.1/Java 7.0

New Features

JSON encoding rules in the SOED runtime

Support for the JSON encoding rules has been added to the SOED runtime.

Current limitations of the JSON SOED encoder/decoder:

  • The deferred decoding feature is not supported.
  • The ValueInFile feature is supported only for SET OF and SEQUENCE OF ASN.1 types.
New command-line options

The -helperAPI <param> and -noHelperAPI <param> command-line options have been added to the ASN.1 Tools for Java. These options tell the compiler to generate optional helper APIs, or not. A parameter is required that can be a single keyword or a comma-separated list of keywords. The keyword specifies the type of helper API; currently, only opentype and pdudecoder are valid.

  • The -helperAPI opentype command-line option affects the representation of open type fields that are constrained by a component relation constraint.
  • The -helperAPI pdudecoder and -noHelperAPI pdudecoder command-line options tell the compiler whether to generate optional PDU and PDU_ID classes that will be used to auto-detect and decode PDUs of unknown types from bits on the wire.
Contraint validations

Validation of the following constraints has been implemented in the TOED:

  1. Element set specification (x.680 clause 50) - EXCEPT and ALL EXCEPT
  2. Subtype elements (x.680 clause 51)
    • Permitted alphabet
    • Type constraint
    • Pattern constraint
    • Property settings
    • Duration range
    • Time point range
    • Recurrence range
  3. Other constraints
    • Table constraint
    • Component relation constraint
    • Contents constraint


-sampleCode command-line option

The -sampleCode command line option can be specified with both the -soed and the -toed options. Before the change the -sampleCode option was ignored when specified along with the -toed option.

What's New in ASN.1/Java 6.3.1

New Features

The OSS ASN.1 Tools for Java now includes ASN.1 Studio 8.0. For a summary of the improvements in ASN.1 Studio 8.0, see the Enhancements History section.

What's New in ASN.1/Java 6.3

New Features

The following new features have been added:

Support for constraint checking in TOED
New command-line options

The -splitBigEnums #n command-line option reduces the size of a large JVM internal static initializer method by generating static _initMembers...() methods that split the large initializer into parts, which helps overcome the JVM 64K method size limit.

The -limitBigEnums #n command-line option is used when the amount of code needed to initialize named "static final" class instances that represent ENUMERATED or INTEGER with named numbers exceeds the 64K limit.


Java class improvements

The Java classes that are generated to represent INTEGER types with named numbers now contain an inner "public static class Value" that includes a "public static final long" constant for each named number. This feature is useful when named numbers are present in the Java "switch" statement.

Method improvements

The following methods of the com.oss.asn1.Coder class (available for SOED and TOED) are used to control the whitespace generated by the XER, E-XER and JSON encoders:

  • public void enableCompact();
  • public void disableCompact();

The following methods of the com.oss.asn1.Coder class (available for TOED) are used to control the whitespace generated by the XER and JSON encoders:

  • public void setIndentWidth(int width);
  • public int getIndentWidth();

What's New in ASN.1/Java 6.2

New Features

The following new features have been added:

JSON Encoding Rules Support

The JSON Encoding Rules are currently available with the osstoed.jar runtime library and the -toed runtime option.

OER and C-OER Encoding Rules Support

The Octet Encoding Rules (OER) and the Canonical Encoding Rules (C-OER) are now available with the -soed compiler option and the oss.jar SOED runtime library.

New command-line option

The ASN.1/Java TOED compiler now supports the -limitMethodSize <number> compiler option, which enables you to split the generated methods that exceed the 64K size limit into smaller parts. The "number" parameter specifies the number of lines of generated source code.

New methods

New methods have been added to the com.oss.asn1.Coder TOED runtime class. The methods enable or disable the Coder options that affect the JSON encoding of SET or SEQUENCE components that are defined using the OPTIONAL or the DEFAULT keyword:

  • enableEncodingOfAbsentComponents()
  • disableEncodingOfAbsentComponents()

The following methods have been added to the com.oss.util.ASN1PrintWriter class:

  • enablePrintingOfImpliedValues()
  • disablePrintingOfImpliedValues()
New Samples

The standards/tap3_bin2xml sample has been created. The sample demonstrates conversion of binary BER-encoded TAP3 records into XML (XER) format.


The TOED BER/DER/OER/PER/XER Encoding Rules now support automatic encoding and decoding of values contained in a BIT STRING or OCTET STRING that is encoded by different encoding rules.

The formatted string that is returned by the toString() method of AbstractData can now be customized. An extra overloaded version of this method has been added to the class. Also, the TOED runtime now includes the com.oss.util.ASN1PrintWriter utility class which improves compatibility with the SOED API.

The error messages issued for invalid encodings of an unconstrained length determinant have been changed. The decoder issues more comprehensive error descriptions.

The runtime classes now provide a better implementation of the hashCode() method.

The ASN.1/Java PER SOED coder has been changed to interpret the unspecified lower bound of the length determinant in accordance with the 2015 version of the X.691 document. The -compat oldPERSemiBoundedStrings flag can be used to restore the compatibility with the previous revisions of the X.691 standard.

What's New in ASN.1/Java 6.1

New Features

C-OER, DER, XER, and CXER Support in TOED
New methods

The SOED and TOED runtimes now define the name() method of the Enumerated class, which easily determines the symbolic name of the enumerator.

The useIndefiniteLengthEncoding() method has been added to the com.oss.asn1.Coder class of the TOED API for better compatibility with the SOED API.

An overloaded version of the enableContainedValueDecoding() method has been added to the com.oss.asn1.Coder class:

public void enableContainedValueDecoding(boolean preserveEncoding)

This method enables automatic decoding of contained values, carried within a BIT STRING or OCTET STRING with contents constraints. This feature is supported in the SOED runtime only.


The TOED runtime has been enhanced to support OER as defined in "Rec. ITU-T X.696 | ISO/IEC 8825-7", rather than only the subset of ASN.1 types as defined in the "NTCIP 1102:2004 Octet Encoding Rules (OER) Base Protocol" document.

The ASN.1/Java compiler has been changed to generate the type-safe getXXX() method for each alternative of the CHOICE type.

The ASN.1 compiler now informs the user about warnings and errors that were suppressed because relaxed mode is enabled by default.

The compiler now accepts comments within compiler command files. The "--" characters specify the beginning of a comment and can be placed anywhere on the line. The comment continues until either a subsequent "--" is reached or the line ends.

When the same coder object is used to decode from a byte buffer and then from a stream, the second attempt no longer results in a ClassCastException being thrown in the BER TOED coder.

Previously, some invalid encodings could cause the BER TOED decoder to throw an OutOfMemoryError. Since applications typically do not intercept Java errors, this caused the application to crash. Now the decoder will throw a DecodeFailedException with the OUT_MEMORY status code instead.

The BER and DER TOED decoders will now correctly process open types that are nested in constructed types as child components and have unknown extension values of child components of SEQUENCE, SET, or CHOICE types.

An anomaly in the SOED and TOED runtimes that caused performance degradation when a value of the UTF8String type was decoded has been fixed.

The recent Corrigendum (Rec. ITU X.691 Cor 4 | ISO/IEC 8825-2 Cor 4.) to the X.691 standard fixed a defect in Clause 32.6.1. The definition o f the fractional-value field of a DURATION-INTERVAL-ENCODING type is changed from

INTEGER(1..999, ..., 1000..MAX)


 INTEGER(0..999, ..., 1000..MAX)

The ASN.1/Java PER encoders/decoders will now behave according to the new definition.

What's New in ASN.1/Java 6.0

New Features

New runtime library

A new runtime library, the OSS ASN.1/Java Time-Optimized Encoder/Decoder (TOED), has been implemented.

TOED is optimized for faster encoding and decoding. The new ASN.1/Java TOED runtime, osstoed.jar, uses encoders/decoders generated by the compiler, dramatically speeding up the encoding/decoding process compared to the interpretive ASN.1/Java runtime, oss.jar, which is now referred to as the ASN.1/Java Space-Optimized Encoder/Decoder (SOED).

BER, basic PER (aligned and unaligned), and OER encoding rules are supported. Support for DER, CER and XER is coming soon. Limited constraint checking is available, only to the extent that is required by the corresponding encoding rules (PER, OER).

For more information of the differences between the ASN.1/Java SOED and TOED runtime packages, see the SOED versus TOED section.

OER Support

Support for the Octet Encoding Rules (OER), as specified by the NTCIP 1102:2004 Octet Encoding Rules (OER) Base Protocol document, has been implemented in the ASN.1/Java compiler, the TOED runtime library and ASN.1 Studio. OER messages can generally be encoded/decoded significantly faster compared to BER and PER messages, while being only slightly less compact than PER messages. Support for OER in ASN.1/Java SOED and ASN.1/Java LED will be provided in the next release.

New compiler options

New compiler options, -soed and -toed, have been added. These options instruct the compiler to generate either Java classes that are optimized for a smaller code size (to be used with oss.jar at run time), or Java classes that are optimized for speed (to be used with osstoed.jar at run time). The -soed option is selected by default when neither -soed nor -toed are specified. The -soed and -toed options are mutually exclusive; if specified simultaneously, the option specified last on the command line takes precedence.

New samples

The set of samples provided includes new samples illustrating the use of protocols based on the SAE J2735 Intelligent Transportation standard, as well as the RRC, S1AP, and X2AP LTE protocols based on 3GPP Release 10.

This documentation applies to the OSS® ASN.1 Tools for Java release 7.1 and later.

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 Java 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 Java are available to you.