> I have the following doubts on BER encoding.
>
>
>    * I would like to know how the extension is handled in the case of
>      ENUMERATED value? (for BER). The explanation given in 18.2.4 of
>      Olivier's book is not very clear for me(second sentence, regarding
>      the
>      extension marker).

Dear Mr. Nidugala:

Whereas having an extension for an ENUMERATED type affects the PER
encoding since the size of the integer needed to represent the value
affects the encoding, having an extension does not affect the BER
encoding. Mr. Dubuisson is only stating that an ENUMERATED value is
encoded the same way whether or nor it has an extension.

>
>    * Example
>      Rights ::= BIT STRING { user-read(0), user-write(1),
>      group-read(2), group-write(3),
>      other-read(4), other-write(5) }
>
>      group Rights ::= { group-read, group-write }
>
>      For the above example, the book gives the encoded value as,
>      Tag : 03 Length : 02 Value : 03 00110xxx.
>      Since the compiler can remove trailing zero, in case of Named
>      BitString, can the value be 03 0011xxxx or 03 001100xx.
>
> Please suggest me.

In BER, the unused bits are don't-cares, that is, whether the x's are 0's
or 1's is all the same. The used bits, on the other hand, are relevant.
Using your above example, group could be represented in any of eight ways,
namely (of course, always preceeded by 03 02 03) the binary values

    00110 000,
    00110 001,
    00110 010,
    00110 011,
    00110 100,
    00110 101,
    00110 110, and
    00110 111.

In DER, this is not true, for DER only permits one possible encoding for
a value, namely

    00110 000.


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




Reply via email to