TOP

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

Applies to: ASN.1/Java 8.2

What's New in ASN.1/Java 8.2

New Features

New compiler directives

The OSS.NOENCODE and OSS.NODECODE compiler directives reduce the generated TOED code by excluding the encoding or decoding routines for the directive's operand. Under certain conditions, the generated code can be reduced even further using the new -compactNoDecode compiler option.

New compiler option

The -compactNoDecode compiler option instructs the compiler to generate a compact version of Time-Optimized Decoder code for fields marked by the NODECODE directive.

New samples

New samples for release 16 of LTE and 5G protocols have been created:

  • TS 38.463 (5g_e1ap_r16) V16.0.0 (2020-01)
  • TS 38.473 (5g_f1ap_r16) V16.0.0 (2020-01)
  • TS 38.413 (5g_ngap_r16) V16.0.0 (2020-01)
  • TS 38.423 (5g_xnap_r16)V16.0.0 (2020-01)
  • TS 36.413 (lte_s1ap_nb_iot_r16) V16.0.0 (2020-01)
  • TS 36.413 (lte_s1ap_r16) V16.0.0 (2020-01)
  • TS 36.423 (lte_x2ap_nb_iot_r16) V16.0.0 (2020-01)
  • TS 36.423 (lte_x2ap_r16) V16.0.0 (2020-01)

Samples for releases 13, 14, and 15 of LTE and 5G protocols have been updated to use the most recent versions of ASN.1 schemas available:

  • TS 38.463 (5g_e1ap_r15) V15.5.0 (2019-10)
  • TS 38.473 (5g_f1ap_r15) V15.7.0 (2019-10)
  • TS 38.413 (5g_ngap_r15) V15.5.0 (2019-10)
  • TS 38.331 (5g_rrc_r15) V15.7.0 (2019-09)
  • TS 38.423 (5g_xnap_r15) V15.5.0 (2019-10)
  • TS 29.171 (lte_lcs_r14) V14.3.0 (2019-09)
  • TS 29.171 (lte_lcs_r15) V15.3.0 (2019-09)
  • TS 36.455 (lte_lppa_r15) V15.2.1 (2019-01)
  • TS 36.331 (lte_rrc_cv2x_r14) V14.12.0 (2019-09)
  • TS 36.331 (lte_rrc_cv2x_r15) V15.7.0 (2019-09)
  • TS 36.331 (lte_rrc_nb_iot_r13) V13.14.0 (2019-06)
  • TS 36.331 (lte_rrc_nb_iot_r14) V14.12.0 (2019-09)
  • TS 36.331 (lte_rrc_nb_iot_r15) V15.7.0 (2019-09)
  • TS 36.331 (lte_rrc_r13) V13.14.0 (2019-06)
  • TS 36.331 (lte_rrc_r14) V14.12.0 (2019-09)
  • TS 36.331 (lte_rrc_r15) V15.7.0 (2019-09)
  • TS 36.413 (lte_s1ap_nb_iot_r13) V13.8.0 (2018-09)
  • TS 36.413 (lte_s1ap_nb_iot_r14) V14.9.0 (2019-07)
  • TS 36.413 (lte_s1ap_nb_iot_r15) V15.7.1 (2019-10)
  • TS 36.413 (lte_s1ap_r13) V13.8.0 (2018-09)
  • TS 36.413 (lte_s1ap_r14) V14.9.0 (2019-07)
  • TS 36.413 (lte_s1ap_r15) V15.7.1 (2019-10)
  • TS 36.423 (lte_x2ap_nb_iot_r13) V13.8.0 (2019-10)
  • TS 36.423 (lte_x2ap_nb_iot_r14) V14.8.0 (2019-10)
  • TS 36.423 (lte_x2ap_nb_iot_r15) V15.7.0 (2019-10)
  • TS 36.423 (lte_x2ap_r13) V13.8.0 (2019-10)
  • TS 36.423 (lte_x2ap_r14) V14.8.0 (2019-10)
  • TS 36.423 (lte_x2ap_r15) V15.7.0 (2019-10)
  • TS 25.331 (umts_rrc_r15) V15.4.0 (2018-09)

Improvements

Improved UTF8String API

The API for UTF8String is now streamlined and made uniform across all available representations of this ASN.1 type. Also, support for supplementary Unicode characters, such as emoji symbols, is enhanced in all representations of UTF8String.

The SOED and TOED compilers now generate an identical set of constructors for all representations of the UTF8String ASN.1 type:

  • The constructor that initializes an instance from UTF-8 bytes (byte[]).
  • The constructors that initialize an instance from UTF-16 characters (String, char[]).
  • The constructor that initializes an instance from an array of Unicode codepoints (int[]).

The SOED and TOED runtimes now define an identical set of getter and setter methods for all representations of the UTF8String ASN.1 type:

  • The getter methods that present the value as UTF-8 bytes, UTF-16 characters, or as an array of 32-bit Unicode codepoints:
    public byte[] byteArrayValue();
    public char[] charArrayValue();
    public String stringValue();
    public int[] intArrayValue();
  • The setter methods that initialize the value from UTF-8 bytes, UTF-16 characters, or from an array of 32-bit Unicode codepoints:
    public void setValue(byte[]);
    public void setValue(char[]);
    public void setValue(String);
    public void setValue(int[]);
  • The getSize() method that returns the number of 32-bit Unicode codepoints in a UTF8String:
    public int getSize()
  • The getChar() method that retrieves the i-th 32-bit Unicode codepoint from a UTF8String value:
    public int getChar(int i)

The confusing behavior of the API with an --<UNBOUNDED>-- representation of UTF8String is eliminated:

  • The constructor and the setter methods no longer expect that the String or char[] argument specifies UTF-8 bytes rather than UTF-16 characters. Use the constructor or the setter with the byte[] argument to initialize the value from UTF-8 bytes.
  • The stringValue() and the charArrayValue() methods now return UTF-16 characters rather than values of UTF-8 bytes. Use the byteArrayValue() method to retrieve the bytes of a UTF-8 encoding.
  • The getSize() method now returns the number of 32-bit Unicode codepoints in the value rather than the number of octets in the UTF-8 encoding of the value. Use byteArrayValue().length to retrieve the length of the UTF-8 encoding.
  • The getChar() method now returns the i-th 32-bit Unicode codepoint rather that the value of the i-th byte of the UTF-8 encoding. Use byteArrayValue()[i] to retrieve the i-th byte of the UTF-8 encoding.

The --<BMPSTRING>-- representation is enhanced to support values that contain supplementary Unicode characters. Previously, when the value of a --<BMPSTRING>-- representation included a surrogate pair that represented a supplementary Unicode character, the encoding of such value was not supported.

Enhanced JIAAPI class

The JIA_ValueReader class of the JIAAPI add-on is enhanced to support parsing of arbitrary values of open types. Previously, the JIA_ValueReader class was able to parse only open types that carried values of primitive built-in ASN.1 types, such as, INTEGER, BOOLEAN, OBJECT IDENTIFIER, etc.

Other improvements
  • The ASN.1 compiler has been fixed to correctly apply the EXTENSIBILITY IMPLIED option in the module definition by making the following inextensible types defined in the module to be implicitly extensible:
    • All ENUMERATED types
    • SET, SEQUENCE, and CHOICE types whose type definitions match some other type definitions inside other modules that do not have the EXTENSIBILITY IMPLIED option
    Previously, the EXTENSIBILITY IMPLIED option did not affect the above types, which could cause incorrect PER encodings of their values at runtime. The new -allow BadExtensibilityImplied option can be used to restore the old behavior. For example, the Enum type definition in the following module is equivalent to the textual insertion of an extension marker ("...") at the end of the type definition: "ENUMERATED { a(1), b(2), ...}".
    Mod DEFINITIONS EXTENSIBILITY IMPLIED  ::= BEGIN
    Enum ::= ENUMERATED { a(1), b(2)}
    END
    Previously, due to type sharing of similar type definitions for Set and SetExt, as well as for Choice and ChoiceExt, the implicit extensibility of SetExt and ChoiceExt was lost:
    Mod DEFINITIONS AUTOMATIC TAGS ::= BEGIN
    Set ::= SET {a INTEGER, b BOOLEAN}
    Choice ::= CHOICE {a INTEGER, b BOOLEAN}
    END
    
    ModExt DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED  ::= BEGIN
    SetExt ::= SET {a INTEGER, b BOOLEAN}
    ChoiceExt ::= CHOICE {a INTEGER, b BOOLEAN}
    END
  • The ASN.1/Java compiler generates the helper inner class with the fixed name 'Value' in the Java class that represents INTEGER with named numbers or the ENUMERATED ASN.1 type. This helper class facilitates the use of INTEGER or ENUMERATED with the Java 'switch' statement. Previously, when detecting possible name conflicts for this helper class, the compiler considered only the immediate enclosing type instead of considering all the enclosing types up to the top-level type. As a result, not all possible name conflicts were detected and the generated Java source failed to compile. For example, for the following syntax:
    Value ::= SEQUENCE {f1 INTEGER {one(1), two(2)}}
    the compiler previously generated the following code:
    public class Value extends Sequence {
    . . .
       public static class F1 extends INTEGER {
    . . .
          public static final class Value {
                public static final long one = 1;
                public static final long two = 2;
          }
    . . .
  • The ASN.1 compiler has been fixed to correctly apply ASN1.WorkingSet directives with module names without definitive module identifiers when the target module definition includes a definitive module identifier and is referenced in the IMPORTS statement with the SUCCESSOR syntax. Previously, an error about undefined types was issued in non-relaxed mode and the types from the specified working set were not included in the generated code in relaxed mode.

  • The ASN.1 compiler has been fixed to issue an error when governors of an information object set or value set used as actual parameters and the actual parameter of the paramdummy governor included in an instance of a parameterized type are not compatible. The new -allow flag, incompatibleGovernorsForObjectValueSets, can be used to suppress these errors.

    For example, the governor of the information object set, MACAlgorithms, used as the actual parameter in MessageAuthenticationCodeAlgorithm, is ALGORITHM, but it should be MAC-ALGORITHM according to the definition of the parameterized type AlgorithmIdentifier {}.
    B4468 DEFINITIONS ::= BEGIN
    
       MACAlgorithms ALGORITHM ::= {  ...   }
        MessageAuthenticationCodeAlgorithm ::=  AlgorithmIdentifier {MAC-ALGORITHM, {MACAlgorithms}}
    
        AlgorithmIdentifier {ALGORITHM-TYPE, ALGORITHM-TYPE:AlgorithmSet} ::=
          SEQUENCE {
            algorithm   ALGORITHM-TYPE.&id({AlgorithmSet}),
            parameters  ALGORITHM-TYPE.&Params({AlgorithmSet}{@algorithm})
          }
        ALGORITHM ::= CLASS {
            &id OBJECT IDENTIFIER UNIQUE,
            &Params
        }
        MAC-ALGORITHM ::= CLASS {
            &id OBJECT IDENTIFIER UNIQUE,
            &Params,
            &Other OPTIONAL
        }
    END
  • The behavior of the generated TOED constraint checker is now aligned with the behavior of the SOED constraint checker. Previously, when a component relation constraint with an extensible information object set was checked and the data did not match any row in the constraining information object set, the TOED reported a constraint violation error while the SOED ignored errors of this kind. Now the generated TOED constraint checker does not report an error in this case.

What's New in ASN.1/Java 8.1

New Features

Partial decoding for BER and DER:

The partial decoding feature is now available with BER, DER, PER, UPER, OER, and COER.
Note that BER/DER support requires osstoed.jar version 8.1+.

New samples

New samples have been created for the following:

Improvements

The ASN.1/Java TOED compiler no longer generates incorrect code in the validate() method when the constraint expression contains a union of inner subtype constraints. Previously, false validation errors occurred.

The ASN.1/Java SOED compiler no longer generates invalid type information when a type with component relation constraints is defined inline in an information object. This invalid type information caused a error in the constraint checker at run time.

The ASN.1/Java compiler now correctly compares BIT STRING type values with named bits when one of the values is specified as {}. Previously, the compiler incorrectly compared such values; consequently, a false constraint violation could be reported or a real violation could be missed. For example, a constraint violation was not reported for value y:
  Test DEFINITIONS ::= BEGIN
      EndEntityType ::= BIT STRING {app(0), enrol(1)} (SIZE (8))(ALL EXCEPT ''H)

      y EndEntityType ::= {}
  END


What's New in ASN.1/Java 8.0

New Features

The ASN.1 compiler now supports X.680 Amendment 1, which relaxes the IMPORTS clause to allow symbols to be imported from the latest module version, as indicated by the object identifier. The IMPORTS clause can now include WITH SUCCESSORS and WITH DESCENDANTS as the SelectionOption.

The ASN.1 compiler now supports the new -enablePartialDecode and -partialDecodeOnly command line options. These options are available when the -toed option is specified or implied by default. The options instruct the compiler to generate code that makes the new coder.decodePartial() TOED runtime API method available to the user. In contrast to the decode() method, the new method does not return the decoded PDU value. Instead, it invokes a user-defined callback method when decoding each field that is marked by the new OSS.DataCallback (or OSS.InfoCallback) compiler directive and optionally passes the decoded field value to it. The partial decode feature enables the user to

  • Extract data without writing code to access deeply nested fields of complex PDUs.
  • Reduce the memory footprint of applications that contain minimal information in their PDUs.

The feature is available for the PER, UPER, CPER, CUPER, OER, and COER encoding rules.

A new encoder option has been implemented for the JSON encoder. This option selects the alternate form of encoding for a BIT STRING or OCTET STRING with a contents constraint that does not include an ENCODED BY clause. The option is configured with the following JSONCoder methods:
     public void encodeContainedValuesAsText();
     public void encodeContainedValuesAsHex();

The new -userConstraintPDUs | -noUserConstraintPDUs command line options have been implemented. These options tell the compiler whether or not (the default) to generate Java classes for type parameters of the CONSTRAINED BY constraint when such types are defined inline.

The ASN.1 compiler now supports a special type of absolute reference notation that applies to the OSS compiler directives. The notation allows you to access ASN.1 types located within WITH COMPONENTS and WITH COMPONENT(inner subtype) clauses and consists of two dollar signs '$$' followed by an index number that indicates a particular WITH COMPONENTS or WITH COMPONENT clause.
The notation can be used to assign user-defined names within CONSTRAINED BY clauses that are present within an inner subtype or a compiler-generated structure (the ASN.1 compiler creates compiler-generated structures when a contents constraint is applied within an inner subtype). The rules that apply to the new notation are similar to the ones that apply to the absolute reference notation for the CONSTRAINED BY syntax.

A new encoder option that permits customization of the JSON encoder output has been implemented. The option is enabled via the new enableJSONCoderInterface() method of the JSONCoder class. To customize the JSON encoder output, the user must subclass the generated Java class using the OSS.UserClass compiler directive and implement the JSONCoderInterface in the subclass. Then, after enableJSONCoderInterface() is called, the JSON encoder will invoke the JSONCoderInterface that is implemented by the subclass to obtain customized JSON tokens that represent the value being encoded. This encoder option is currently supported only by the SOED runtime.

New samples

New samples have been created for the following:

  • The DIN EN 15722 Intelligent transport systems - ESafety - ECall minimum set of data standard. The sample demonstrates how an ECallMessage message can be created and serialized to UPER bits using the API of generated Java classes.
  • The eUICC Profile Package standard. The sample demonstrates how a eUICC Profile Package can be constructed and saved to the disk file using the API of generated Java classes.
  • The GSMA Remote SIM Provisioning standard. The sample demonstrates the invocation of the GetBoundProfilePackage function of the ES9+ interface at the SM-DP+ using the API of generated Java classes.
  • Release 15 of the UMTS RRC protocol: TS 25.331 (UMTS RRC) 15.3.0 (2018-06).
  • The Bilateral Transfer protocol (BTP): ILP-RFC 0023 Draft 4. The sample demonstrates communication between BTP peers that involves the Prepare, Fulfill, and Reject requests.

New samples for 5G NGAP, XnAP, E1AP, and F1AP protocols for 3GPP Release 15 have been created. The samples for the LTE S1AP, X2AP, M2AP, M3AP, RRC, LCSAP, LPPa, SBcAP, and XwAP protocols have been updated to 3GPP Release 15.

New samples in the advanced category have been created to explain the use of the partial decode feature:
     partial
     s1ap_pd (uses 3GPP S1AP V15.3.0 specification)

Improvements

The ASN.1 compiler has been changed to generate Java classes compatible with the TOED runtime by default. Previously, when neither -toed nor -soed was specified on the ASN.1/Java command-line, Java classes compatible with the SOED runtime were generated.

The -paramtypesuperclass option is now supported with both the SOED and TOED. Before this change it was not available with the TOED and was ignored when specified along with the -toed option.

The ASN.1 compiler and TOED runtime have been enhanced to support the DeferDecoding directive for the BER and DER encoding rules. For other encoding rules (PER, OER, XER, and JSON), the compiler generates encoders and decoders that ignore the directive and encodes or decodes the value in a single pass.


What's New in ASN.1/Java 7.2

New Features

The OSS ASN.1 Tools has been enhanced to support the Canonical Packed Encoding Rules (ALIGNED and UNALIGNED), as specified by ITU-T Recommendation X.691 (08/2015) | ISO/IEC 8825-2:2015.

Both the compiler and runtime have been enhanced to support the Java Platform Module System (JPMS), which was introduced in Java 9. The compiler now supports the '-javamodule <name>' option that packages the generated classes into the Java module with the specified <name>. The software distribution now includes an extra set of runtime libraries that are packaged as Java 9 modules. These new libraries are available in the mlib/ directory of the ASN.1/Java installation and can be used only with JDK 9.

The ASN.1 compiler now supports the UPPERCAMELCASED and LOWERCAMELCASED keywords in the NAME and TEXT JER encoding instructions. You can now describe a wider range of JSON data in an ASN.1 schema.

The public API of the JIAAPI value parser will now parse concatenated values and value assignments from an arbitrary java.io.Reader object. A relaxed parsing mode is now implemented: non-critical deviations from the expected syntax are ignored.

New samples

A new sample that demonstrates processing of 3GPP CDR files (TS 32.297) has been created. 3GPP CDR files contain a non-ASN.1 file header and non-ASN.1 record headers, while record bodies are encoded by one of the ASN.1 encoding rules (BER, PER unaligned, PER aligned, or XER). The sample shows how one can skip over non-ASN.1 content, feed ASN.1 data to the ASN.1/Java API, and convert CDR records to Java objects.

New samples have been created for release 14 of the LTE protocols and existing samples for release 12 and 13 have been updated to the most recent versions of the available ASN.1 schemas:

  • TS 29.171 (LCSAP) V13.3.0 (2017-06)
  • TS 29.171 (LCSAP) V14.1.0 (2017-06)
  • TS 36.455 (LPPA) V14.3.0 (2017-09)
  • TS 36.443 (M2AP) V13.3.0 (2016-03)
  • TS 36.443 (M2AP) V14.0.1 (2017-09)
  • TS 36.444 (M3AP) V13.2.0 (2016-03)
  • TS 36.444 (M3AP) V14.1.0 (2017-06)
  • TS 36.331 (RRC CV2X) V14.4.0 (2017-09)
  • TS 36.331 (RRC NB IOT) V13.7.1 (2017-09)
  • TS 36.331 (RRC NB IOT) V14.4.0 (2017-09)
  • TS 36.331 (RRC) V12.15.1 (2017-09)
  • TS 36.331 (RRC) V13.7.1 (2017-09)
  • TS 36.331 (RRC) V14.4.0 (2017-09)
  • TS 36.413 (S1AP NB IOT) V13.6.0 (2017-06)
  • TS 36.413 (S1AP NB IOT) V14.4.0 (2017-10)
  • TS 36.413 (S1AP) V12.7.0 (2016-03)
  • TS 36.413 (S1AP) V13.6.0 (2017-06)
  • TS 36.413 (S1AP) V14.4.0 (2017-10)
  • TS 29.169 (SBCAP) V12.10.0 (2017-09)
  • TS 29.169 (SBCAP) V13.3.0 (2017-09)
  • TS 29.169 (SBCAP) V14.1.0 (2017-09)
  • TS 36.423 (X2AP NB IOT) V13.7.0 (2017-06)
  • TS 36.423 (X2AP NB IOT) V14.4.0 (2017-09)
  • TS 36.423 (X2AP) V12.9.0 (2016-07)
  • TS 36.423 (X2AP) V13.7.0 (2017-06)
  • TS 36.423 (X2AP) V14.4.0 (2017-09)
  • TS 36.463 (XWAP) V14.2.0 (2017-06)

A new sample for release 14 of the UMTS RRC protocol has been created:

  • TS 25.331 (UMTS RRC) 14.4.0 (2017-09)

Improvements

The ASN.1/Java compiler will now automatically turn off the default -relaxedMode option when the -designerWarnings option is specified.

Type-safe getter methods have been added to the EmbeddedPDV.Identification and the External.Encoding universal classes to align the API of these classes with the API generated for CHOICE ASN.1 type:

public Syntaxes getSyntaxes();
public ObjectIdentifier getSyntax();
public INTEGER getPresentation_context_id();
public Context_negotiation getContext_negotiation();
public ObjectIdentifier getTransfer_syntax();
public Null getFixed();

public OpenType getSingle_ASN1_type();
public OctetString getOctet_aligned();
public BitString getArbitrary();


What's New in ASN.1/Java 7.1

New Features

JSON

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:ARRAY
  • JER:BASE64
  • JER:NAME
  • JER:OBJECT
  • JER:TEXT
  • JER:UNWRAPPED
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)

Improvements

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

Improvements

-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.

Improvements

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 COER Encoding Rules Support

The Octet Encoding Rules (OER) and the Canonical Encoding Rules (COER) 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.

Improvements

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

COER, 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.

Improvements

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)

to

 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 8.2 and later.

Copyright © 2020 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.