Asn1Compiler v3.2
Release Notes
Contents
Latest changes
The compiler version is
Asn1Compiler v3.2.2. The runtime library version is Asn1RT v3.2.2.
Asn1Compiler
v3.2.2/Asn1RT v3.2.2 brings the following changes:
Enhancements
ASN.1 compiler enhancements
ASN.1 runtime enhancements
Bug fixes
ASN.1 compiler fixes
ASN.1 runtime fixes
- For a SEQUENCE/SET type, after first PER encoding the type without any extension,
then adding an extension to the type and re-encoding it lead to an encoding
without the extension. For example, in that situation :
-
M DEFINITIONS ::= BEGIN
S ::= SEQUENCE {
a INTEGER,
...,
b BOOLEAN OPTIONAL}
END
- Writing in Java :
S s = new S();
s.setA(1);
encoder.encode(s);
// then adding the extension to the previously encoded type
s.setB(true);
encoder.encode(s);
- Or in C# :
S s = new S();
s.A = 1;
encoder.Encode(s);
// then adding the extension to the previously encoded type
s.B = true;
encoder.Encode(s);
- Both code above lead to an incorrect encoding the second time, where
the extension component was not handled.
Summary of changes
Asn1Compiler
v3.2.1/Asn1RT v3.2.1 brings the following changes:
Enhancements
ASN.1 compiler enhancements
ASN.1 runtime enhancements
Bug fixes
ASN.1 compiler fixes
- SEQUENCE OF values were not handled properly. For example :
- T ::= SEQUENCE OF CHOICE {i INTEGER} and v T ::= {i : 99}
- T ::= SEQUENCE OF OCTET STRING and v T ::= {'1111'H}
- T ::= SEQUENCE OF TIME and v T ::= { "2000-01-01T00:00:01"
}
ASN.1 runtime fixes
- Extended-XER : USE-NIL types were encoded without the asn1 namespace (urn:oid:2.1.5.2.0.1).
- Extended-XER : BASE64 was not possible for BMPString or UniversalString.
- Mixing Extended-XER and other encoding rules lead to errors when decoding
CHOICE types with USE-NIL.
Asn1Compiler
v3.2.0/Asn1RT v3.2.0 brings the following changes:
Enhancements
ASN.1 compiler enhancements
ASN.1 runtime enhancements
Bug fixes
ASN.1 compiler fixes
- The compiler failed when parsing an ENUMERATED starting with an extension
marker ("..."). This construction is however forbidden by ASN.1.
For example, the construct below lead to a compilation error :
ASN.1 runtime fixes
Asn1Compiler
v3.1.2/Asn1RT v3.1.2 brings the following changes:
Enhancements
ASN.1 compiler enhancements
ASN.1 runtime enhancements
Bug fixes
ASN.1 compiler fixes
- The compiler fails when parsing some cstring value construct when defined
in a fixed-type-value-set field of an object. For example, the construct below
lead to a compilation error :
ASN.1 runtime fixes
-
The runtime method decoder.decode(byte[] data, int offset, int length,
Asn1Type type) (or decoder.Decode in C#) behaved wrongly. When passing
an offset and a length with (offset+length) being equal to data.length (or
data.Length in C#), the method returned an error specifying offset and length
were not correct, which was a bug.
Asn1Compiler
v3.1.1/Asn1RT v3.1.1 brings the following changes:
Enhancements
ASN.1 compiler enhancements
- A new setting javaGenerator.generation.tuning.generateXmlNames
(cSharpGenerator.generation.tuning.generateXmlNames)
allows the compiler to generate names specified by the XER encoding instructions
TEXT and NAME instead of the ASN.1 names. This option is efficient if the
'ExtendedXER' encoding rules have been specified.
- A new setting cSharpGenerator.generation.tuning.generatePartialClasses
allows the compiler to generate C# partial classes (valid for .NET 2.0).
ASN.1 runtime enhancements
- The method decode(byte[], offset, length) / Decode(byte[], offset, length)
has been added to the IDecoder interface (it was existing on all decoders
but was not made visible through the interface).
Bug fixes
ASN.1 compiler fixes
ASN.1 runtime fixes
-
The method util.ByteArray.byteArrayToBCDString (Util.ByteArray.ByteArrayToBCDString)
which was existing since the beta A version has been renamed byteArrayToPackedBCDString
(ByteArrayToPackedBCDString).
-
The method toString() or ToString() applied to an OBJECT IDENTIFIER with
two arcs defined only lead to an Exception.
- In C#, XER/CXER/EXER decoders wrongly decode value with too big component
number. For example, the value v OBJECT IDENTIFIER ::= {1 2, 18446744073709551615}
was wrongly decoded as {1 2 255}.
Asn1Compiler
v3.1.0/Asn1RT v3.1.0 brings the following changes:
Enhancements
ASN.1 compiler enhancements
- The compiler supports the X680 Amendment 3 for the Time types. This amendment
provides support for the full range of time types specified in ISO 8601:2004
by the introduction of a generic type called TIME and a number of useful and
defined time types that are derived from it (and are subsets of it). A subtype
notation is specified that can be used to define additional time types, and
that enables designers to produce variations of those types suited to their
particular applications (for example, restrictions on the values used to represent
midnight). The useful time types are DATE (specified using year, month, day),
TIME-OF-DAY (specified using hours, minutes, seconds, to various accuracies),
DATE-TIME (specified by a combination of a DATE and a TIME-OF-DAY) and DURATION
(specified in any combination of time units). The defined time types include
types that can be used to specify dates and times (in various forms), time
intervals, and recurring time intervals.
- Basic tuning properties have been added to the configuration so that it
is possible to tune the code generation.
ASN.1 runtime enhancements
- The runtime supports the X690/X691/X693 amendments for the TIME types leading
to the addition of new runtime types Asn1TimeType (TIME), Asn1DateType (DATE),
Asn1DateTimeType (DATE-TIME), Asn1DurationType (DURATION) and Asn1TimeOfDayType
(TIME-OF-DAY).
- The runtime toString()/ToString() methods on each ASN.1 type now provide
the representation of the instance value using the ASN.1 value notation. The
alternative using the Asn1TypeExplorer class is still available to get a format
that presents more information (for instance the reference type name of each
components of a constructed type). Yet, all basic values are now written with
the ASN.1 value notation.
- Generic methods have been made available on the Asn1ConstructedType (SEQUENCE,
SET, CHOICE) and Asn1ConstructedOfType (SEQUENCE OF, SET OF) to allow manipulation
of internal components without knowing their exact type.
- NOTE : The generic method getAsn1TypeElements(Java)/GetAsn1TypeElements(C#)
of Asn1ConstructedOfType has been replaced by getAsn1TypeList (Java)/GetAsn1TypeList(C#).
It is declared "deprecated (Java)/Obsolete(C#)" and shall be removed
in a further release.
- The Asn1TypeExplorer class allows to define whether the explorer sees all
the syntax nodes or not (OPTIONAL components that are not defined can thus
be seen and more, constructed types SEQUENCE/SET/CHOICE can be 'expanded'
even if the components are not instantiated).
- The validate()/Validate() method now throws the Asn1ValidationException
(which extends the Asn1Exception) for a clearer exception handling while using
validating encoders or decoders.
Bug fixes
ASN.1 compiler fixes
- The following DEFAULT value notation construct was leading to a generation
error (occured when the element of the SEQUENCE OF / SET OF was an OBJECT
IDENTIFIER or a RELATIVE-OID) :
ASN.1 runtime fixes
- When the component of a SEQUENCE/SET/CHOICE is an open type that can not
be resolved (no relation constraint is applied to it), the generation was
leading to a getter method returning an Asn1Type for that component, which
is not correct. Indeed, since the open type cannot be resolved no Asn1Type
can be returned. This has been fixed by not generating the accessor for the
component anymore.
For example, in S ::= SEQUENCE
{c1 ABSTRACT-SYNTAX.&Type}, assuming s
is an instance of S, s.getC1()
in Java or s.C1 in
C# were always returning 'null'. Now, one must write
- in Java : s.c1().setValue(myType)
to set the Asn1Type myType in c1 and s.c1().byteArrayValue()
to get the open type value and,
- in C# : s.C1.SetValue(myType)
to set the Asn1Type myType in c1 and, after decoding, s.C1.ByteArrayValue
to get the open type value.
- Constraints on INTEGER mixing value ranges and single value constraints
(such as (1..15 | 30)) were wrongly treated leading to validation errors.
Asn1Compiler
v3.0.1/Asn1RT v3.0.1 brings the following changes:
Enhancements
ASN.1 compiler enhancements
ASN.1 runtime enhancements
Bug fixes
ASN.1 compiler fixes
ASN.1 runtime fixes
- The resetType() in java / ResetType() in C# method was not resetting correctly
the CHOICE types. The method now resets properly the chosen instance. Since
the method is invoked before each decoding method of decoders, if the user
application uses the same instance for decoding several encodings, this error
was leading to incorrect results and abnormal validation errors.
Asn1Compiler
v3.0.0/Asn1RT v3.0.0 brings the following changes:
Enhancements
ASN.1 compiler enhancements
- The Extended XML Encoding Rules (EXTENDED-XER or EXER - specification X693
Amendment 1) are treated by this new release. This includes the handling of
XER encoding instructions to manage the new encoder class ExtendedXerEncoder
and the new decoder class ExtendedXerDecoder in the runtime library.
- The use of {...} instead of a DefinedObjectSet in a component relation constraint
is accepted by the compiler. This construct is normally forbidden by X680.
- A new setting controls if the compiler automatically rename the class to
be generated for a type assignment with a name equalling an already recorded
assignment name without caring of case. asn1ToXml.definitions.autoRenameIgnoringCaseIdenticalNames
may be useful on non case sensitive platforms (such as Windows) avoiding the
user to rename the ASN.1 name. The default value is false on case sensitive
platforms and true on non case sensitive ones.
- New settings allow the user to define the package/namespace for each ASN.1
module: javaGenerator.generationPackage.'module'
for Java or cSharpGenerator.generationNamespace.'module'
for C#. These settings are useful for isolating a specific module used
by more than one API. They are to be combined with javaGenerator.generation.'module'
for Java or cSharpGenerator.generation.'module'
for C# which control whether the module should be generated or not.
ASN.1 runtime enhancements
- The Extended XML Encoding Rules (EXTENDED-XER or EXER - specification X693
Amendment 1) are treated by this new release. The runtime library offers the
new encoder class ExtendedXerEncoder and the new decoder class ExtendedXerDecoder
handling the XER encoding instructions.
- The Basic XER encoder "newlines" property has changed to offer
a better control on the characters to be used as the line separator. The property
is now "lineSeparator" and the associated methods are setLineSeparator/getLineSeparator
in Java (or LineSeparator property in C#). The old property "newlines"
is still valid but it is recommend to use this new property.
Note: the property is also available on the ExtendedXerEncoder.
- To make it easier in some situations to handle the SEQUENCE OF/SET OF types,
the methods
- getAsn1TypeElements in Java (GetAsn1TypeElements in C#) which return
a List in Java (IList in C#) of Asn1Type and,
- addAsn1Type(Asn1Type) in Java (AddAsn1Type(Asn1Type) in C#)
have been added on the Asn1SequenceOfType and Asn1SetOfType. This allows handling
elements as Asn1Type as well as getting a List(IList) view upon them.
- The add method in Java (Add in C#) of Asn1SequenceOfType and Asn1SetOfType
returns the instance of the holder type instead of void. This allows t.add(value1).add(value2);
(t.Add(value1).Add(value2);)
- The reserved words "stdout" and "stderr" may be used
in the "internalErrorLogDir" property to redirect the internal errors
logs to the standard output or standard error stream respectively.
- The property that controls the bit value used for padding in PER encoders
has been made visible: "paddingWithZeroBit" specifies if the padding
bit value is the zero or not.
- (Since Beta B) A new property "encodingDefaultValues" has been
added on non canonical encoders (BerEncoder, Aligned/UnalignedBasicEncoder,
XerEncoder and ExtendedXerEncoder) that controls whether DEFAULT values of
components of constructed types (SEQUENCE or SET) are encoded or not. If the
property is "false", this means that the encoder checks if the defined
value is the DEFAULT value and does not encode it if it is the DEFAULT values.
If the property is "true", this means that it encodes the DEFAULT
value. By default, the binary encoders (BER, PER) do not encode the DEFAULT
values whereas the XML encoders (XER, EXER) do encode them. Note that the
DER encoder never encodes the DEFAULT values whereas the Canonical XER encoder
always encodes them.
- For Java : The BER decoder was wrapping a stream that was unable to support
mark operations within a BufferedInputStream. This removes the user the ability
to read the given stream properly. The BER decoder no longer uses a BufferedInputStream.
- For Asn1IntegerType (ASN.1 INTEGER) : The methods longValue() in Java (GetLongValue()
or LongValue property getter in C#) is now throwing a ClassCastException (InvalidCastException
in C#) if the internal value of the INTEGER is outside the limits of a long
(getting the BigInteger value should be considered instead). The same way,
the method intValue() (GetIntValue() or IntValue property getter in C#) is
now throwing a ClassCastException (InvalidCastException in C#) if the internal
value of the INTEGER is outside the limits of an int (getting either long
or BigInteger value should be considered instead).
- (since Beta B) : the property "encodingTypeIdentificationForUseTypeChoiceFirstAlt"
used on the ExtendedXerEncoder allows to specify if the type identification
must be encoded for the first alternative of a CHOICE with a USE-TYPE encoding
instruction. By default, this is false. The type identification is thus not
encoded unless the alternative is a CHOICE type with a USE-UNION encoding
instruction.
Bug fixes
ASN.1 compiler fixes
- The following value notation construct wasn't handled correctly:
- REAL value notation with a decimal dot were rejected by the compiler.
- In some situations, even in AUTOMATIC TAGS, the compiler issued an error
while compiling a SEQUENCE/SET/CHOICE type with components having equal tag
values.
- If mixing PER encoding rules and BER/DER or XER encoding rules, the generated
classes for a SEQUENCE/SET type with an extension group, could be wrong in
some situations. This could lead to an internal error (and thus a log file)
when encoding with PER encoders. For example, encoding value {a
1, c 2, f 3} of type ErrorType defined below lead to an error
-
ErrorType ::= SEQUENCE {
a [1] INTEGER,
...,
[[ b [2] INTEGER OPTIONAL,
c [5] INTEGER OPTIONAL
]],
f INTEGER,
...
}
- Value notation using COMPONENTS OF was not correctly handled in some cases.
For example, the definitions below generated a value v_S2 with the f1 component
missing:
- (Since Beta B) Some complex DEFAULT values were ignored by the compiler.
For example, the following DEFAULT value for component c1 was ignored:
ASN.1 runtime fixes
- The control characters were not handled by the XER encoders and decoders.
They are now handled.
- C# BER/DER decoders were wrongly issuing an internal error (and thus a log
file) if the network Stream, used for decoding, was closed unexpectedly. The
correct behavior is to issue an Asn1Exception (E_InputStreamError) in this
situation.
- Canonical XER OID used in contents constraints was leading to an incorrect
use of "CanonicalXERDecoder" (which doesn't exist) instead of "XerDecoder".
- The contents constraints with an ENCODED BY definition was too strictly
controlled and as leading to an error. The current behavior is to issue a
warning in case the OID used for the encoding rules cannot be recognized as
an ASN.1 encoding rules OID.
- In PER, encoding an OID with no value (no arcs defined which is normally
forbidden) was leading to an internal error instead of an Asn1Exception
Asn1Compiler
v2.6.1/Asn1RT v2.6.1 brings the following changes :
Enhancements
ASN.1 compiler enhancements
- The logic controlling the encoding rules passed to the compiler has been
modified. The property "asn1API.encodingRulesFamily"
and related methods in the factory have been withdrawn from the set of properties
a user can specify. Thus, the property "asn1API.encodingRulesFamily"
is no longer the one to be used to specify the encoding rules. To specify
the encoding rules, one should use the "asn1API.encodingRules"
property. With this property several encoding rules (',' separated) can now
be defined; this replaces and enhances the '*' asn1API.encodingRulesFamily
property. A strict control will be made at runtime regarding the encoding
rules that have been set at ASN.1 compilation. Consequently, the syntax of
properties to apply on coders or decoders have been modified : to set a property
for a specific encoder for example, one shall specify it through "asn1API.encoder.'encodingRules'.'property'"
where 'encodingRules' is (one of) the encoding rules specified in the "asn1API.encodingRules"
property.
This enhancement may lead to modify the configuration file :
using "asn1API.encodingRules"
property is now mandatory, and properties to apply on coders are set adding
'encoding rules.' before the name of the coder property (for example, if asn1API.encodingRules=BER,
asn1API.encoder.validating=true
should be replaced by asn1API.encoder.BER.validating=true).
This enhancement may lead to modify the application code (in
normal situation, if the application uses the factory to create encoders/decoders,
there is no modifications to bring to the code) :
- if encoders/decoders are created directly using the new
keyword instead of using the 'Asn1API'Factory, then the code shall first
invoke 'Asn1API'Factory.init()
in Java or 'Asn1API'Factory.Init()
in C#. Besides, encoders/decoders direct creation will need to be wrapped
in try/catch block catching the Asn1Exception that may be thrown if the
encoder/decoder was not allowed at ASN.1 compilation pass.
- if the application uses 'Asn1API'Factory.getEncodingRulesFamily()
in Java or 'Asn1API'Factory.GetEncodingRulesFamily()
in C# it shall use 'Asn1API'Factory.getEncodingRules()
in Java or 'Asn1API'Factory.EncodingRules
property in C# instead and change the code in consequence (since the encoding
rules 'BER' is returned instead of 'Basic' for example).
- New properties named "asn1ToXml.compile.verbose",
"cSharpGenerator.verbose"
and "javaGenerator.verbose"
has been added in the compiler's configuration file for controlling the output
of messages. The default is "true" so that all messages are issued
as before.
- New properties "javaGenerator.generationSourceFileHeader"
and "cSharpGenerator.generationSourceFileHeader"
allow the user to provide the header of generated source files instead of
the default one.
- New proterties "javaGenerator.cleanGenerationBaseDirectory",
"cSharpGenerator.cleanGenerationBaseDirectory"
are allowing the user to control that the generation directory must not be
deleted by the compiler pass (it is useful if extra information is contained
in this directory).
ASN.1 runtime enhancements
- New properties on the Basic Xer encoders is created : 'encodingXMLDeclaration'
controls the addition of the XML declaration <?xml version="1.0" encoding="UTF-8"?>.
- Canonical PER encoders have been withdrawn since Basic PER encoders behave
exactly the same way. The restriction on Canonical PER encodings are 1- dynamic
sorting for untagged CHOICE components in SET is not handled : generally CHOICE
components are always tagged especially if using the AUTOMATIC tagging and
2 - dynamic sorting the components encoding of a SET OF type is not handled
and components are coded in the order set by the application.
- The restriction on the Canonical XER encoder specifying that the sorting
of SET OF components was not not handled has been removed so that a Canonical
XER encoder now produces regular Canonical XER encodings. The restriction
applying to untagged CHOICE types in SET types is not harmful if SET components
that are CHOICE are tagged (this is always the case in AUTOMATIC tagging).
- A new property has been added for XER encoders to control the sorting of
SET OF encodings : "sortingSetOf".
- In C#, it is no longer useful to add System.Xml to your project's references
when referencing asn1RT.dll
Bug fixes
ASN.1 compiler fixes
ASN.1 runtime fixes
- In C#, NetworkStream passed directly to a decoder was leading to a System.IO.__Error.SeekNotSupported
(even if it is wrapped in a BufferedStream the NetworkStream doesn't support
seeking).
- The Asn1TypeExplorer (and thus the toString() or ToString() methods) were
adding 'null' when there was no reference type. The behavior is fixed so that
nothing is printed, the same way the print ' = value' if there is no
reference type name and no type name (such is the case for unresolved open
types for example) has been turned to 'value' only.
- The Canonical XER encoder didn't encode properly empty SET/SEQUENCE (they
must be encoded as an empty XML element).
- (bug introduced in v2.5.3 for C#). Decoders issue an internal error when
decoding a value of a type with a component relation constraint where the
referenced component is textually defined within a field of a CHOICE/SEQUENCE/SET
type and it is identified by the referencing component which is defined out
of the field type. For example the following type leads to internal error
upon decoding :
Asn1Compiler
v2.5.4/Asn1RT v2.5.4 brings the following changes :
- A new property named "cSharpGenerator.generationAssemblyKeyFile"
has been added in the compiler's configuration file for specifying the generated
AssemblyKeyFile attribute in the generated C# AssemblyInfo.cs file . Unsetting
this property leads to generate AssemblyInfo.cs file for an unsigned assembly.
The default behavior is that the AssemblyKeyFile attribute is "../../%Asn1API.name%.snk"
for a signed assembly.
- The "_" character contained in some type names returned by the
TypeName property in C# or getTypeName() in Java has been removed to match
exactly the ASN.1 type name. For example, SEQUENCE_OF has become SEQUENCE
OF, SET_OF is SET OF, RELATIVE_OID is RELATIVE-OID, CHARACTER_STRING is CHARACTER
STRING...
- CHARACTER STRING, EMBEDDED PDV and EXTERNAL types are now generated (by
the compiling pass) when the ASN.1 syntax contains such a type instead of
being fully contained in the runtime. This reduces the size of the library.
- Instead of throwing the E_NoMoreData exception if the requested number of
bytes to read has not been reached, decoders accept reading the stream again
until data are fully available to continue decoding. This is instresting when
reading data directly from a network stream.
- In some situations (such as if code is Asn1Exception.E_InputStreamError
for example), the inner exception that caused an Asn1Exception can be retrieved
from it using getCause() in Java or InnerException in C#.
- Fix : The XML tag of CHARACTER STRING, EXTERNAL, EMBEDDED PDV, INSTANCE
OF types is SEQUENCE.
- Fix : REAL types filled through the SEQUENCE definition (mantissa, base,
exponent) and when using the base 10 were leading to internal error when trying
to encode the value.
- Fix : Some REAL types values encoding were not correct in CXER.
Asn1Compiler
v2.5.3/Asn1RT v2.5.3 brings the following changes :
- The location of internal errors log files in encoders and decoders can now
be specified. The method setInternalErrorLogDir in Java or InternalErrorLogDir
property in C# can be used for specifying the directory (if none is specified
the default is the working directory).
- The __getIdentifier method on ENUMERATED, INTEGER types has been made visible
as GetIdentifier in C# and getIdentifier in Java. It gives the string identifier
associated to a value as defined by the ASN.1 syntax.
- The methods __isLowerBoundDefined() and __isUpperBoundDefined() have become
IsLowerBoundDefined() in C#/isLowerBoundDefined in Java and IsUpperBoundDefined()
in C#/isUpperBoundDefined() in Java.
- The IsResolvingContent property has been added in IDecoder interface in
C#.
- A new property is available on XerEncoder 'hexStringFormattingUnresolvedOpenTypes'
allows to choose whether unresolved open types are to encoded without changes
or with the content (unresolved) formatted as a hex string. The default behavior
is false so that unresolved open types are always encoded without changes.
- Fix : Some names like TypeName, PrintableValue, ReferenceTypeName are treated
as keywords to avoid errors while compiling generated classes.
- Fix : Imported symbols that are themselves imported from another module
are treated correctly.
- Fix : For ENUMERATED types, enumerations items defined as "identifiers"
only in the syntax were given bad values by the compiler in some situations.
For example, E ::= ENUMERATED
{a(1),b,c} was leading to a=1, b=0 and c=1 instead of a=1, b=0, c=2.
X680 clause "19" is now handled properly.
- Fix : SEQUENCE OF NULL
types were leading to uncompilable code in C# (example generation for such
types have been fixed too).
- Fix : joint-iso-ccitt is accepted as a synonym of joint-iso-itu-t.
- Fix : EMBEDDED-PDV and CHARACTER STRING types were badly encoded/decoded.
- Fix : Empty BIT STRING or OCTET STRING were badly decoded in XER.
- Fix : relation constraint were not always effective in some situations in
XER decoders.
- Fix : some zero length octet aligned bit fields were wrongly aligned in
ALIGNED PER.
Asn1Compiler
v2.5.2/Asn1RT v2.5.2 brings the following changes :
- The evaluation version now throws an Asn1Exception when it is not valid
(or the license file is not found).
- The previous ReleaseNotes omit to indicate that properties isIgnoringPostPaddingBits
and isIgnoringPaddingBitValue have been replaced by ignoringPostPaddingBits
and ignoringPaddingBitValue.
- The example generator not longer generates examples for all types if no
type have been specified in the Java(or csharp)ExampleGenerator.forType.n
property.
- Fix : The compiler remains silent while generating nothing when the generation
directory cannot be created because the file systems forbids it. An error
is now issued by the compiler pass.
Asn1Compiler
v2.5.1/Asn1RT v2.5.1 brings the following changes :
- All classes derived from Asn1Type class now support equals/hashcode/clone(from
Cloneable interface providing a deep copy) in Java or Equals/GetHashCode/Clone(from
ICloneable interface providing a deep copy).
- Unknown extensions that are received when decoding a SEQUENCE / SET / CHOICE
/ ENUMERATED can be given to the application if required (through adapted
methods) instead of being silently ignored.
- Asn1Compiler now accepts constructions such as v2 OBJECT IDENTIFIER ::=
{v1} where v1 is an OBJECT IDENTIFIER defined value, although forbidden by
X680 ({} should be removed actually).
- The compiler replaces ANY (DEFINED BY)? constructions by TYPE-IDENTIFIER.&Type
leading to an Asn1OpenType definition. It remains the user's responsibility
to create a relation constraint for ANY DEFINED BY constructions if needed.
- HexStringValue property has been added to the Asn1BitStringType C# class
or setHexStringValue() and hexStringValue() methods to the Asn1BitStringType
Java class allowing the use of hstring values for instances of that class.
- The ENUMERATED represented by the Asn1EnumeratedType class can be handled
by an int (the most common cases) or a long (if there is a value inside the
enumeration is beyond the int limits). The generation generates the appropriate
getter/setter methods depending on the enumeration. The decoders/encoders
always treat the value as a long.
- in the configuration file, javaGenerator property is no longer true by default
(this will lead to a configuration files minor change).
- the evaluation license file location has changed (please refer to ReadMe
- evaluation version).
- Fix : bad PER encoding for Asn1UTCTimeType and Asn1GeneralizedTimeType because
there were treated as unknow multiplier strings. The types are now extending
Asn1VisibleStringType (since they are defined like this in the ASN.1 standard)
whereas the AsnObjectDescriptorType extends the Asn1GraphicStringType. The
Asn1UsefulType have been removed since useless!
- Fix : the generation doesn't produce the appropriate relation constraint
when the most external textually enclosing type is a SEQUENCE OF or SET OF
and the atNotation doesn't use the '.' marker.
- Fix : the generation crashes when it encounters a type from object such
as Type ::= SEQUENCE OF obj.&Type or if obj.&Type is a component of
a constructed type.
- Fix : the compiler allows the use of aliases of module names in the IMPORTS
list when the definitive identifier is provided.
- Fix : the compiler allows to use hstring for BIT STRING value (or DEFAULT
value) but generates non-existent method for a Asn1BitStringType type. This
is fixed by the addition of the C# HexStringValue property in the Asn1BitStringType
(with SetHexStringValue() and GetHexStringValue() methods) or Java setHexStringValue()
or hexStringValue() methods.
- Fix : the compiler rejects information object and object set assignments
when an OBJECT IDENTIFIER type is used within object class or its fields.
- Fix : the compiler rejects an assignment of a value of a type with a components
relation constraint when there is nested {} in a field value, also a type
with a components relation constraint is rejected if it includes a DEFAULT
value with {}.
- Fix : if no type is selected for the example generation (making an example
generation for each type), the example generation crashes if it encounters
a CHOICE.
- Fix : for Java generation only, if components named getXYZ, setXYZ or hasXYZ
exist in a SEQUENCE or SET with a xYZ component, this lead to Java compilation
error. In such situations, the special token '_' (by default) is now added
to getXYZ_, setXYZ_ and hasXYZ_ methods for accessing the xYZ component.
- Fix : in Java generation only, a bug in Asn1GeneralizedType/Asn1UTCTimeType
in Java lead to bad validation result for month 01 (january).
- Fix : in CSharp generation only, if a smart value printer is defined, the
generated code doesn't compile because a wrong GetPrintableValue is invoked.
- Fix : in CSharp generation only, the "ignoringPaddingBitValue"
property is inefficient. The behavior of this property has been fixed to allow
the PER decoders check padding bit value must be '0' (the property must be
set to false).
- Fix : the XER decoder accepts special REAL values as empty elements tags
<PLUS-INFINITY/>, <MINUS-INFINITY/>, <NOT-A-NUMBER/> (in
addition to INF, -INF and NaN text elements); the XER encoder encodes those
special elements as empty elements tags also.
Asn1Compiler
v2.5.0/Asn1RT v2.5.0 brings the following changes :
- NOTE: this release is an important step. Efforts have been made
to provide better performance and a better API. Since the user API has been
modified, this will lead existing applications to rewrite part of code to
take the most of the new API style.
- Performance on BER/DER encoders and decoders has been much improved both
in Java and C#.
- Java base package becomes com.unigone.asn1RT (business has been removed)
to get shorter names.
- C# base namespace becomes Unigone.Asn1RT to get shorter names and to be
more C# like.
- C# API uses C# names (the first letter is capitalized), use of properties
and indexers instead of method is now possible.
- In Java, valueAsXxx() methods have become xxxValue() (for example valueAsLong()
is now longValue()).
- In C#, setValue(xxx)/valueAsXxx() are available through the property XxxValue
(for example setValue(long)/valueAsLong() become LongValue). SetValue(xxx)
and XxxValue() methods are also available.
- In C#, SEQUENCE OF/SET OF elements are accessible through an indexer allowing
writing MySequenceOf[i].
- In both Java and C# the access to members of constructed types are made
easier with the use of shortcuts when the member is a basic type. Use myType.setMember(xxx)
or myType.getMember() in Java or myType.Member in C# to set/get the member
value.
- Asn1UTCTimeType and Asn1GeneralizedTimeType offer calendarValue()/DateTimeValue.
- A validate()/Validate() method has been made visible on Asn1Type. This allows
a validation against the ASN1 description constraints and validity of the
internal value of a type. A decoder/encoder can be made "validating"
with a compilation setting. If the option is set it means before any encode()
method the encoder first validates the type to encode and it means that a
decoder will always validate a received value right after a decode() method
before passing it to the user. This can however be achieved manually calling
type.validate() before encoding or after decoding if the "validating"
option has not been set.
This feature was formerly performed by encoders and by decoders (although
less completely).
- The resolveContent()/ResolveContent is fully visible for users who need
advanced access to open types.
- the has_'alternative' method has been replaced by is_'alternative' and no
longer exists on CHOICE types (both methods were available in older release
to ensure compatibilty).
- __reset() method on Asn1Type has been renamed resetType()/ResetType() to
avoid naming conflicts and to let this method available to the user.
- In the example generator, you can now choose the alternative of a CHOICE
you need.
Asn1Compiler
v2.1.1/Asn1RT v2.1.1 brings the following changes :
- reset() method on Asn1Type has been renamed __reset(). This will avoid naming
conflict with potential ASN.1 components named "reset". Since the
method is not directly used by the user (but by the decoder to reset internal
values of types before decoding), this may lead to minor rewriting.
NOTE : this may lead to minor application rewriting.
- Fix : WITH COMPONENTS constraints may have lead to errors in the ASN.1 compilation
pass.
- Fix : named values of INTEGER used in default values when conflicting with
an Information Object name generates an error in the ASN.1 compilation pass.
Asn1Compiler
v2.1.0/Asn1RT v2.1.0 brings the following changes :
- valueAsType() method no longer throws Asn1Exception since it is called during
the main decoding process. If the resolveContent setting is set true (which
is the default) main decoding invokes resolveContent() before returning to
the caller. This makes open, content constrained or subtype constrained open
types decoded. Thus valueAsType() returns the contained type properly instantiated.
To get previous behavior, advanced use may consist of setting resolveContent
to false on the decoder and first invoke __resolveContent() method, then valueAsType()
on the containing type.
NOTE : this may lead to minor application rewriting.
- the setValue(int numbit, boolean value) (setValue(int, bool) in C#) has
been added to the Asn1BitStringType interface to make the BIT STRING easier
to fill.
- a new property is offered on BER encoder "removingTrailingZeroesInBitStringWithNamedBits"
(or set/IsRemovingTrailingZeroesInBitStringWithNamedBits() on the BerEncoder)
which allows to decide whether trailing zeroes can be removed from a BIT STRING
with a named bits list. Default is true (which is always the case in DER).
- the has_'member'() method is -only- offered for testing presence of OPTIONAL,
DEFAULT components or the chosen alternative of CHOICE. In addition, the alias
is_'alternative'() method can be used for testing the chosen alternative of
a CHOICE. The has_xxx() method was formerly present on all named types, application
can thus consider removing useless tests.
NOTE : this may lead to minor application rewriting.
- Evaluation version now reads the license file only once on decode() or encode()
and not at each decoding or encoding. This makes load tests possible with
the evaluation version.
- Asn1Compiler now offers the possibility to generate examples of how to decode
or encode types. It requires to set properties containing the list of desired
types in the configuration file. This powerful feature helps writing yor application
faster.
Asn1RT
v2.0.5 brings the following changes :
- Object Identifiers with length = 0 are accepted by BER/DER/PER/XER decoders.
- PER decoders: padding bit value may optionally not be ignored ("isIgnoringPaddingBitValue"
property). Default behavior is ignoring padding bit value (both 1 or 0 are
accepted although it should be "0" according to the X691 specification).
- getPrintableValue() method on BIT STRING has changed for BIT STRING containing
no named bit set. Instead of naming every set bit, it gives the ASN.1 value
equivalent (that may be truncated if the BIT STRING value contains more than
8 bytes).
- has_xxx(boolean) method has been added to allow easy removal of xxx component
of a constructed type. This may be useful to remove an optional component
before relaying a PDU.
- Fix : PER decoders: usedBytes() method was giving a relative (to the open
type begining) value if an exception occurred during an open type decoding.
Asn1Compiler
v2.0.4 / Asn1RT v2.0.4 brings the following changes :
- Pre-encoding and post-decoding options are available for XerEncoder and
XerDecoder which allows encoding/decoding huge XML document. In particular,
this option is useful for converting huge BER files (like for TAP3) to XML
files and vice-versa.
- For Java, XER decoder now fully integrates a XML parser which means jdom
and crimson are no longer useful. The XML parser is a derivative work from
the XML pull parser of http://www.extreme.indiana.edu implementation MXParser.
This new XERdecoder is much faster than the older one and requires less memory.
Asn1Compiler
v2.0.3 brings the following changes :
- A new option "warnIfIgnoringCaseIdenticalNames" is offered on
the compiler to make it possible to refine assignment names if generation
is to be performed on a non case sensitive platform (such as Windows). With
this option, a warning is printed each time the compiling pass encounters
a name already registered (ignoring case) but generation still goes on. The
warning will help to rename incriminated assignements in the ASN.1 syntax
(if generation is to be performed for non case sensitive platform).
Asn1RT
/ Asn1Compiler v2.0.2 brings the following changes :
- Asn1Type is implementing Serializable interface (Serializable() property
in C#) allowing reading and writing Asn1Type instance from and to an Object
stream.
- Convenient support is provided for "big integers". BigInteger
is used in Java and a substitute byte[] is used for C# (the user has to deal
with this byte[] himself however).
- Subtype constraints for open types are handled making automatic decoding
of the open types (just like for component relation constraint).
- A full support is provided for contents constraints generating code for
"ENCODING MyType ENCODED BY rules" and thus making set and get of
contained value very easy (even when encoding rules are not the same!).
- getNbPostPaddingBits() has been added on PerEncoder to get the number of
bits added to build a complete encoding. This is specially used on Unaligned
encoders (for example in RRC protocol).
- a PerDecoder can now ignore post padding bits (see above) using setIgnoringPostPaddingBits(boolean)
method or "isIgnoringPostPaddingBits" property in the arg file.
- COMPONENTS OF Type where badly treated if Type was a DefinedType.
- Types containing constructed (SET/SEQUENCE) DEFAULT value for a component
were not decoded by BerDecoder/DerDecoder and XerDecoder.
- In previous version it was said "The input stream passed to 'decode'
method is wrapped in a BufferedInputStream for Java / BufferedStream for C#.".
Actually this has been done only for streams that do not support the mark()
method in Java and CanSeek property in CSharp. Other streams are left to the
caller's responsiblity in particular FileInputStream don't support mark()
(same is true for C# FileStream and CanSeek) and it is recommended to wrap
the passed stream in a Buffered stream. Passing a buffered stream to the decode(...)
method would improve decoder performance the same way buffered streams use
improves reading performance.
Asn1RT
/ Asn1Compiler v2.0.1 brings the following changes :
- Asn1TypeExplorer (which is the base of DefaultAsn1PrintWriter) has been
made visible. It can be used for easily build trees with an Asn1Type. Besides
Asn1PrintWriter may be subclassed to get a control on the way values are printed.
- add(Element) and get(index) methods that catches the Asn1Exception offer
an alternative to deal with SEQUENCE OF and SET OF when no post-decoding or
pre-encoding options are used (the caller doesn't have to write the try/catch
block that are used for addElement() and elementAt() methods). A size() method
(Count property for C#) has also been added which returns the same as nbElements().
- A new 'valueAsType()' method has been added on the Asn1ChoiceType. It returns
the instance (Asn1Type) of the chosen alternative.
- The input stream passed to 'decode' method is wrapped in a BufferedInputStream
for Java / BufferedStream for C#.
- 'decode' methods always call type.reset() (type is thus cleaned if ever
'decode' is called within a loop and type is instantiated outside the loop)
- Limited period evaluation scheme instead of modified results.
- Known bugs are fixed.
Asn1RT
/ Asn1Compiler v2.0.0 brings the following changes :
- C# support : the compiler generates C# classes and Java classes. Asn1API
may be Java on the server side and C# on the client side!
- a new decode(byte[] data, int offset, int length, Asn1Type type) method
has been added.
- "$" extra character (added when a 'normal' name cannot be used
because the compiler forbids it) has been replaced by "_". This
character may however be configured by compiler property.
- if %asn1ToXml.inputFile.n% is not set, the compiler looks for files
in %asn1ToXml.inputFile.base% and compile all of them.
- Warning : length() method on Asn1BitStringType has been renamed lengthInBits()
for keeping Java/C# maximum naming compatibility.
NOTE : this may lead to minor application rewriting replacing names only.
- Warning : isDefined_component() has been renamed has_component() method.
NOTE : this may lead to minor application rewriting replacing names only.
- a new valueAsHexString() method has been added in Asn1OctetStringType which
gives the hexadecimal string representation of the byte array.
- Warning : setHexaStringValue(String) has been renamed setHexStringValue(String)
to be consistent with valueAsHexString() method.
NOTE : this may lead to minor application rewriting replacing names only.
- Warning : equals(Object) method on Asn1Type has been better named isEqualTo(Object)
since there is no override of getHashCode() for Asn1Type.
- Internal naming has changed to avoid potential conflicts with subclasses
members/methods (especially with CSharp).
- Known bugs are fixed.
Asn1Compiler
v1.6.3 brings the following changes :
- 'constants' values are created alongside the 'asn1' value for simple types
: INTEGER, string, BOOLEAN, CHOICE with a simple type alternative.
- changed : getNamedBitSetSize() method becomes 'static'.
Asn1RT
/ Asn1Compiler v1.6.2 brings the following changes :
- added : getNamedBitSetSize() method on Asn1BitStringType() : for BIT STRING
with named bits, this gives the size of the BitSet to be used for working.
It is equal to the highest named bit plus one.
- for SEQUENCE and SET types : mandatory components are checked by decoders
if type is not extensible. Thus, calling isDefined_component() method
is no more necessary in such a case (remains necessary for extensible types).
Asn1RT
/ Asn1Compiler v1.6.0 brings the following changes :
- calls to decode() method on decoders and to encode() method on encoders
now throw Asn1Exception which wraps any decoding and encoding problem (the
message returned by the exception is the same once returned by the decoder
or encoder object). addElement(), elementAt() on SEQUENCE OF and SET OF types
throw Asn1Exception, the same way valueAsType() on open types.
NOTE : this will lead to minor application rewriting wrapping existing code
with try/catch.
- a convenient factory class is provided in the generation package for creation
of appropriate encoder and decoder on an Asn1API. It is used for holding properties
on decoder and encoder but also on types.
- SEQUENCE OF and SET OF types must now use newElement() method to create
the element and then use addElement(element) to add it in its containing type.
In previous versions, newElement() method returned a new instance of an element
and added it automatically to its containing SEQUENCE OF or SET OF type. Automatic
addition is now not done any more but addElement(element) method must always
be called.
NOTE : addElement() throws Asn1Exception. This new feature will lead to minor
application rewriting.
- new options are added on SEQUENCE OF and SET OF types : pre-encoding and
post-decoding properties allow saving memory usage since values are decoded
only when accessed or encoded as soon as they are added using addElement().
This option is used for very big pdu like those used for TAP3 billing records
for example.
- several minor enhancements are brought and known bugs are fixed
Asn1RT
v1.5.2 brings the following changes :
- XER are fully treated. XER encoder offers the Canonical encoding with the
same minor restrictions applied to the DER and Canonical PER encoder.
Asn1RT
v1.5.1 brings the following changes :
- PER are fully treated (Aligned and Unaligned variant). PER encoder offers
the Canonical encoding with the same minor restrictions applied to the DER
encoder.
Canonical encoder doesn't deal with :
- dynamic sorting for untagged CHOICE components in SET : generally AUTOMATIC
tagging is applied to syntaxes using PER encoding!
- sorting the components encoding of a SET OF type is not achieved; components
are coded in the order set by the application. [This restriction is not
very bothering because it is generally recommended to use SEQUENCE (OF) types
instead of SET (OF) for syntaxes using Canonical encoding]
- object sets are taken into account for building tables used in table and
relation constraints.
NOTE : object sets lead to a Java class definition, it has been named xxx_objectSet
(where xxx is the name of the ASN.1 information object set). this has lead
to rename Java classes for information objects (renamed yyy_object instead
of yyy_) and information object classes (zzz_objectClass instead of zzz__).
This may lead to application minor rewriting replacing names only.
- DefaultBerEncoder and DefaultBerDecoder classes have disappeared, replaced
by BerEncoder and BerDecoder classes for simplicity reasons.
NOTE : this may lead to minor application rewriting replacing names only.
- REAL types are treated.
- several minor enhancements are brought and known bugs are fixed :
- method "println" in class "com.unigone.business.asn1RT.io.DefaultAsn1PrintWriter"
is available.
- instantiate a new decoder to decode an open value (for multi-threading).
-
Asn1RT v1.4.0
- memory usage has been decreased and time execution has been improved for
runtime.
-
Asn1Compiler v1.3.0
- single value, value range, permitted alphabet and size constraints have
been added to prepare PER encoding. (refer to the Asn1API javadoc)
-
Asn1RT
v1.3.0
- SET can now be filled properly (a bug prevented that if there were DEFAULT
components!).
- values of defined types that are ASN.1 string can now properly initialized.
Asn1Compiler, Asn1Browser, Asn1API are licensed by uniGone. They are members of uniGone Asn1Solutions software.
For further information, email to unigone@unigone.com.
Copyright © uniGone 1999-2008. All Rights Reserved.
uniGone 4 Route de la Noue 91190 GIF SUR YVETTE France.