I read the following PER encoding example from the book "ASN.1 complete".

Choice-example ::= CHOICE
           { normal NULL,
             high NULL,
             ... !2 -- see para 14.6 for exception handling --
             medium NULL  }

  first-choice Choice-example ::= normal:NULL
  second-choice Choice-example ::= medium:NULL

first-choice: E: 0  I: 0  C: (a total of two bits)

second-choice: E: 1 (extensions bit set)
                     I: 000000 (index as a normally small whole number)
                     L: P00000001 (general length "wrapper")
                     C: 00000000 (padded encoding of NULL)

Should the length and contect of the second-choice be

                     L: P00000000
                     C:

, since there is no need to encode NULL?

Dear Mr. Chin:

In a way, you're right, but you have misinterpreted what the C field contains. Indeed NULL is not encoded, but this leaves the extension an empty bit string. An extension is actually an open type and an open type is itself treated as a full encoding unto itself. So, just as if we were to encode a solitary PDU containing only

   null NULL ::= NULL

as 00000000 since there cannot be a PER encoding without bits, so also an extension containing, in effect, that same null would be encoded as 00000000.

Please let me know if, rather than make it clearer, I only managed to make it cloudier.

=====================================================================
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