On Tue, 19 Mar 2002, Nicholas, Richard wrote:

> Gentlemen,
>
> According to paragraph 11.6 of X.690 (1997), the components of a SET OF are
> sorted by comparing them as if they were octet strings with their lengths
> padded so they are the same length (my paraphrasing).  Obviously the tags of
> all of the components will be equal (when DER encoded at least).

Not so, the tags of all components are not necessarily equal when
DER-encoded.  Consider:

        Foo ::= SET OF Bar

        Bar ::= CHOICE {
                a       INTEGER,
                b       IA5String,
                c       BOOLEAN
        }

        differentTags Foo ::= { a : 7, b : "Hi!", c : TRUE}

> Is the first byte that is used for comparison the first length byte or
> the first byte of the component value?

The first byte of the SET OF component value, which in the above is
the tag of "a", "b" or "c".

> The following is an example to clarify if the question is not clearly
> stated.  Assuming these are the DER-encoded components of a SET OF (its a
> SET OF Attribute), which of the following two orderings is correct?
>
> 30 18 06 09 2A 86 48 86 F7 OD 01 09 03 31 0B 06 ...
> 30 1C 06 09 2A 86 48 86 F7 OD 01 09 05 31 0F 17 ...
> 30 23 06 09 2A 86 48 86 F7 OD 01 09 04 31 16 04 ...
>
> 30 18 06 09 2A 86 48 86 F7 OD 01 09 03 31 0B 06 ...
> 30 23 06 09 2A 86 48 86 F7 OD 01 09 04 31 16 04 ...
> 30 1C 06 09 2A 86 48 86 F7 OD 01 09 05 31 0F 17 ...

The first.

-------------------------------------------------------------------------
Bancroft Scott                               Toll Free    :1-888-OSS-ASN1
OSS Nokalva                                  International:1-732-302-0750
[EMAIL PROTECTED]                                 Tech Support :1-732-302-9669 x-1
1-732-302-9669 x-200                         Fax          :1-732-302-0023
http://www.oss.com


Reply via email to