I would like to make sure if my understanding of BIT STRING encoding is
correct.

Let's assume in the following expamle that only ellipsoid point is
supported, i.e. bit 0 is set to 1.

supportedGADShapes    [6] IMPLICIT BIT STRING {
        ellipsoidPoint  (0 ),
        ellipsoidPointWithUncertaintyCircle  (1 ),
        ellipsoidPointWithUncertaintyEllipse  (2 ),
        polygon  (3 ),
        ellipsoidPointWithAltitude  (4 ),
        ellipsoidPointWithAltitudeAndUncertaintyElipsoid  (5 ),
        ellipsoidArc  (6 )} ( SIZE( 7 .. 16 ) ) OPTIONAL}

In my opinion this encodes (BER) into:

03 02 01 (= 1 unused bit) 80

I would very much appreciate if anybody could confirm this.

It depends upon how precise you would like it to be. BER is less exacting about the encoding of trailing 0s than DER. For BER

03 02 01 80 means '1000000'B
03 02 07 80 means '1'B

In both cases the first bit is set; the difference, as you can see, is whether we bother encoding the remaining bits. If this were DER, trailing zeroes are removed from named bit BIT STRINGs, so the only possible encoding would be 03020780; in BER, both are acceptable. Actually, for BER even 03020280, 03020380, 03020480, 03020580, and 03020680 would be acceptable.

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