Let�s consider the following two cases:

1).
field CHOICE
{
   field1 SEQUENCE
   {
      field11 BOOL
      field12 INTEGER
   }

   field2 SEQUENCE
   {
      field21 BOOL
      field22 REAL
   }
}

and

2).
field CHOICE
{
   field1 REAL

   field2 CHOICE
   {
      field21 REAL
      field22 BOOL
   }
}

BER specifies that the Tag number for a Choice type is the tag of the chosen
type. Because of that, in the first case, when decoding an object, there is
no way to tell which is the chosen type because both types will have the
same Tag number (16 as specified by the ASN.1 standard). Moreover, in the
second case, if field2 is the chosen one and within that, field21 is the
chosen one, the Tag number (9 for Real numbers) gets propagated up in the
hierarchy, from the field21 to field2 to field. In this case, when decoding,
it�s impossible to tell whether field1 is encoded or field21 from field2.
Am I missing something?

Eddie Lascu
IBI Group
230 Richmond St. W., 5th Floor
Toronto ON
M5V 1V6
Tel. (416) 596-1930 x205
Fax. (416) 596-0644


NOTE: This e-mail message and attachments may contain privileged and
confidential information.  If you have received this message in error,
please immediately notify the sender and delete this e-mail message.

Reply via email to