Yes. Context specific tagging. ASN.1 requires that
the ambiguity you've specified below not be present.
So this is bust ASN.1 as written, unless it appears
in a module with default AUTOMATIC tags. If so the
ASN.1 would appear as
Field ::= CHOICE {
field1 [0] SEQUENCE {
field11 [0] BOOLEAN
field12 [1] INTEGER
},
field2 [1] SEQUENCE {
field21 [0] BOOLEAN
field22 [1] REAL
}
}
and all of the choice alternatives would
be uniquely tagged.
For more information, see either or both of the
free books available on the oss.com website. Look
for "tags" or "tagging".
Phil
----
Phillip H. Griffin Griffin Consulting
http://ASN-1.com Secure ASN.1 Design & Implementation
+1 919 291 0019 1625 Glenwood Avenue
+1 919 832 7390 (fax) Hayes Barton at Five Points
[EMAIL PROTECTED] Raleigh, North Carolina 27608-2319 USA
--------------------------------------------------------------
Eddie Lascu wrote:
>
> 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.