On Fri, 12 Sep 2003, Tom Yu wrote:

> I noticed in X.680:2002 that ENUMERATED is extensible, while the
> NamedNumberList in INTEGER and the NamedBitList in BIT STRING are not.
> Does anyone know why?  Is it because the NamedNumberList and
> NamedBitList don't actually constrain the set of possible values of
> the type?

Yes.  You have the reason.  NamedNumberLists and NamedBitLists do not
affect the range values available for INTEGERS and BIT STRINGS, so the
extention marker would be meaningless there.  Note that you can use the
extension marker in subtype constraints on INTEGER and BIT STRING types.

Example :  Age ::= INTEGER (0..80, ...)

> 
> Also, it appears that, e.g., a NamedBitList may be attached only to
> the BIT STRING type itself, not to any TypeReference name that happens
> to be a BIT STRING, so it's invalid to have
> 
> Flags ::= BIT STRING (SIZE (32..MAX))
> 
> Flags1 ::= Flags { foo(0), bar(1) }

Correct.  This is not valid.

> 
> but it is valid to have
> 
> Flags ::= BIT STRING (SIZE (32..MAX))
> 
> Flags2 ::= Flags (BIT STRING { foo(0), bar(1) })

This is allowed but probably does not do what you are looking for.  The
effect here is no different than just saying: Flags2 ::= Flags (BIT STRING)

> 
> The interesting question for the Flags2 is whether the size constraint
> from Flags overrides the "strip trailing zero bits of named bit
> strings" rule of DER.  Does anyone know the answer to this?

No it does not affect the DER encoding since neither Flags nor Flags2 have
NamedBitLists.

> 
> On the other hand, perhaps it would not be possible to actually use
> the named bits in the value notation for Flags2, since the named bits
> are associated with anonymous BIT STRING.  Another possibility is
> 
> Flags ::= BIT STRING (SIZE (32..MAX))
> 
> Flags2 ::= BIT STRING { foo(0), bar(1) } (Flags)
> 
> but that causes the size constraint to be overriden on encode by the
> DER bit-stripping rule, right?
> 
> ---Tom
> 

Correct.  The size constraint applies to the abstract value for Flags2.
The encoding for DER is optimized anyway by stripping trailing zeros.

Paul

Reply via email to