Subject: ASN.1 OPTIONAL in TSA

From: "Serafim Gomes" <[email-masked]>
Date: Thu, 25 May 2000 15:30:22 +0100

How can we distinguish the OPTIÕNAL fields if they are not present?

TimeStampReq ::= SEQUENCE  { 
     version                      Integer  { v1(1) }, 
     messageImprint               MessageImprint, 
       --a hash algorithm OID and the hash value of the data to be 
       --time stamped 
     reqPolicy                PolicyInformation      OPTIONAL, 
     nonce                    Integer                OPTIONAL, 
     certReq                  BOOLEAN                DEFAULT FALSE, 
     extensions               [0] Extensions         OPTIONAL 
} 

If we omit reqPolicy, how do we know that the field next to 
messageImprint is Nonce?!! We don´t have tags like in Extension.

I'm working in JAVA with the IAIK package, does anyone work with this 
package?

--
Serafim Gomes
[email-masked]           telm: +351 - 938421578  telf: +351-253548100
http://www.pobox.com/~serafim

---

From: [email-masked] (Peter Gutmann)
Date: Fri, 26 May 2000 03:31:09 (NZST)

"Serafim Gomes" <[email-masked]> writes:

>If we omit reqPolicy, how do we know that the field next to messageImprint is
>Nonce?!! We donM-4t have tags like in Extension.

Yes we do, reqPolicy is tagged as a SEQUENCE, nonce is tagged as an INTEGER
(although it'd help to have the keyword capitalised to make this explicit).

Peter.

---

From: Peter Sylvester <[email-masked]>
Date: Thu, 25 May 2000 17:38:15 +0200 (MET DST)

> messageImprint is Nonce?!! We don´t have tags like in Extension.
You do.
 
SEQUENCE = UNIVERSAL 16 for PolicyPnformation and
INTEGER = UNIVERSAL 2 for nonce, etc.

The CONTEXT 0 tag for extension is there in order to detect it
if none of the previous is present.

Peter

BTW: In order to avoid implementation bugs it seems useful to me
to be sure whether >

actually means the same as  

      extensions [0] IMPLICIT Extensions OPTIONAL

or 
      extensions [0] EXPLICIT Extensions OPTIONAL