By Tag you mean the last five bits (4 to 0) of the Identifier octet (where
bits 7-6 are the Class, and bit 5 is the Primitive/Constructed bit), right?
I thought those are used to tell the type of the member, according to this
table:

BOOLEAN = 0x01
INTEGER = 0x02
BIT_STRING = 0x03
OCTET_STRING = 0x04
NULL = 0x05
OBJECT_ID = 0x06
REAL = 0x09
ENUMERATION = 0x0A
UTF8_STRING = 0x0C
GENERAL_STRING = 0x1B
SEQUENCE = 0x10
SET = 0x11

For all my real members I set the the Identifier octet field to 0000 1001
(Universal, primitive, real number). Is there a way to embed the index of
the member within the sequence in the Tag part as well?

Thanks,
Eddie L

-----Original Message-----
From: Conrad Sigona [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 20, 2005 10:19 AM
To: Eduard Lascu
Cc: [email protected]
Subject: RE: [ASN1] Encoding of a real with default value in BER

Dear Mr. Lascu:

You tell them apart by the tag. For example, if I have three optional
elements in a SEQUENCE, I have to use tags to avoid any ambiguity, like
this

    Z ::= SEQUENCE {
                     a [0] REAL OPTIONAL,
                     b [1] REAL OPTIONAL,
                     c [2] REAL OPTIONAL
    }

If I don't use tags, each REAL would take the default tag and I couldn't
tell them apart. Thus, when decoding, if I see [0] and [2] but not [1], I
know that a is present, b is absent, and c is present.

In PER, there is a preamble with a bit map specifying which optional
elements are present, but your question deals with BER.

=====================================================================
Conrad Sigona                    Voice Mail     : 1-732-302-9669 x400
OSS Nokalva                      Fax            : 1-614-388-4156
[EMAIL PROTECTED]                   My direct line : 1-315-845-1773

_______________________________________________
ASN1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1

Reply via email to