TOP

ASN.1/Java Runtime Package Overview

Applies to: ASN.1/Java v8.7

Overview

The OSS runtime package includes the following:

  • The ASN.1/Java universal classes
  • A Java package (created by the ASN.1 Java compiler). Its name is derived from the name of the last input .asn file or the name specified with the -output option.

Here are some of the features available with the runtime package:

  • Printing of ASN.1 values
  • Implementing coding services for BER, CER, DER, JSON, OER, COER, PER, XER, CXER, E-XER, encoding rules
  • Constraint checking

For information about individual classes, see the OSS TOED API (Time-Optimized Encoder/Decoder) or OSS SOED API (Space-Optimized Encoder/Decoder) section.

The runtime library classes in the .jar files in the lib directory of the OSS ASN.1 Tools for Java installation folder are different. The library used at runtime must match the Java class generating option that was specified while running ASN.1 compiler, as follows:

Command-line option Class library file
-soed oss.jar
-soed -lean osslean.jar
-toed (default) osstoed.jar

Limitations

Encoding Rules Limitations
DER There is no support for encoding a SET OF type with a ValueInFile directive (HugeSetOf).
CER There is no support for the ValueInFile compiler directive.
JSON There is no support for:
  • The ValueInFile compiler directive with the TOED runtime.
  • The ValueInFile compiler directive for types other than SET OF and SEQUENCE OF with the SOED
    runtime.
  • The DeferDecoding compiler directive.
  • Tracing with the TOED runtime.
  • Relay-safe encoding/decoding with the TOED runtime.
OER/COER There is no trace support for the OERCoder/COERCoder with the TOED runtime.

Strict constraint validation is not available with the TOED runtime. The OER/COER TOED does only basic
checks of the values that are passed to the encoder. For integer types, the encoder ensures that the
value fits the number of octets computed from the subtype constraints. For restricted KMC character
strings, BIT STRINGs and OCTET STRINGs that are constrained to a fixed size, the encoder ensures that
the length of the value matches the fixed size.

The OER/COER TOED provides limited support for automatic coding of BIT STRINGs and OCTET STRINGs
with contents constraint. Automatic coding is supported only when a contents constraint omits the
ENCODED BY clause.

The following compiler directives are not supported:
  • ASN1.DeferDecoding
  • ASN1.ValueInFile
  • OSS.Truncate
PER There is no support for the DeferDecoding compiler directive.
CPER There is no support for the DeferDecoding compiler directive.
There is no support for the SET OF, GeneralString, or GraphicString types.
XER There is no support for:

  • The ValueInFile compiler directive.
  • The DeferDecoding compiler directive.
  • The -nodebug compiler option.
E-XER There is no support for:
  • The -lean compiler option or the Lean Encoder/Decoder.
  • BIT STRING and OCTET STRING types with a CONTAINING clause.
  • The -relaySafe compiler option.
  • The -nodebug compiler option.
  • The ValueInFile compiler directive.
  • The DeferDecoding compiler directive.
  • Tracing with the EXERCoder.
The features mentioned above are not allowed at runtime. If you are interested in any of these features
for E-XER, contact Sales <info@oss.com>.
Other limitations

In some cases, the ASN.1 compiler generates a huge amount of Java code, which might cause the
Java compiler to report a code too large error. The error can occur in the following situations:

  • For deeply nested type definitions that cause a code too large error on metadata (typeinfo)
    constructor calls.
  • For initialized value constructor calls when many deeply nested values are used.
  • In sample code generated for huge type definitions.
  • In ASN.1 modules with a large number (over 2000) of defined types and the -jiaapi option is used.
  • When initializing a large number of named items of ENUMERATED types, INTEGERs with named
    numbers, or BIT STRINGs with named bits.
To avoid the error in the first three cases, the huge initializers can be split into smaller parts by using
the -splittypeinfo or -splitvalues compiler option, and the huge sample code can be split with the
-splitsamplecode option. For ENUMERATED types, INTEGERs with named numbers, or BIT STRINGs with
named bits, use the -splitBigEnums or -limitBigEnums option.

SOED versus TOED

The following table summarizes the important differences between the Space-Optimized Encoder/Decoder (SOED) and the Time-Optimized Encoder/Decoder (TOED).

Feature SOED TOED
Command-line options

These command-line options are ignored:

  • -compactNoDecode
  • -decodeOnly
  • -enablePartialDecode
  • -encodeOnly
  • -limitMethodSize
  • -partialDecodeOnly

These command-line options are ignored:

  • -cer, -exer
  • -csv
  • -dtd
  • -indexinfoobjectsets
  • -jiaapi
  • -lean
  • -sampleCode
  • -splitsamplecode
  • -splittypeinfo
  • -userconstraints
  • -xsl
Directives

These directives are ignored:

  • OSS.DataCallback
  • OSS.InfoCallback
  • OSS.NODECODE
  • OSS.NOENCODE

These directives are ignored:

  • ASN1.ConstraintFunction
  • ASN1.ValueInFile, OSS.NOCOPY, OSS.OBJHANDLE
  • OSS.DTD
  • OSS.ENCODABLE
  • OSS.NODEFAULTVALUE
       (specified with -oer | -coer)
  • OSS.SampleCode
  • OSS.Stylesheet
Runtime Packages

The UNSIGNED class is not present in the SOED
com.oss.asn1 package.

The following interfaces are not present in the
SOED com.oss.asn1 package:

  • ASN1Type
  • UniqueKey

Generic applications that rely on using the JIA
API are not compatible with the TOED runtime.

The TOED runtime currently provides support
for BER, DER, JSON, OER, COER, PER Aligned,
PER Unaligned, XER, and CXER.

The following classes are not present in the
TOED com.oss.asn1 package:

  • All classes with the "Huge" prefix, except
    HugeInteger
  • ASN1Type
  • AbstractDataPositions
  • AbstractDataWithPositions
  • CERCoder
  • CSVTool
  • CSVPrintFailedException
  • EXERCoder
  • Position
  • XERDocument

The following interfaces are not present in the
TOED com.oss.asn1 package:

  • ByteStorage
  • CharStorage
  • CustomFormatting
  • ExternalChecker
  • HugeRelaySafe
  • Index
  • IndexProcedure
  • JSONCoderInterface
  • JSONWriter
  • ObjectReader
  • ObjectStorage
  • ObjectWriter
  • Printable
  • Storage
  • StorageManager
  • XERCoderInterface

The following classes are not present in the
TOED com.oss.util package:

  • ASN1ObjidIriFormat
  • ASN1PrintWriter
  • CompressOutputStream
  • DecompressInputStream
  • SampleUtil

The com.oss.storage package is not present in
the TOED runtime.

The com.oss.metadata package is reduced and is
intended only for internal use in the TOED
runtime.

Java Representations

The following ASN.1 types are represented
differently when compiled for the TOED runtime:

  • Constrained INTEGER types that can be
    represented with unsigned 64-bit integers are
    represented by the com.oss.asn1.UNSIGNED
    class.
  • SEQUENCE or SET components are
    represented by public instance variables.
  • SEQENCE OF or SET OF components are
    represented by a public ArrayList variable.
Coding Services

The following coding services are not available
with the TOED runtime:

  • CER and E-XER coders
  • Conversion of Java objects to CSV format
  • Decoding with positions
  • Access to partially decoded PDUs after decoder error
  • Strict decoding
  • Storage management for huge values
  • JIA API

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

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