Paul Long wrote:
> 
> John,
> 
> Cool. Is the CONTAINING construct merely a semantic constraint or does
> it effect the encoding? 

Not sure what you mean by that.  An encoding is invalid unless the octet
string contains an encoding of X.  (The full syntax allows the addition
of ENCODED BY to indicate that X is not encoded by the same encoding
rules as the type the OCTET STRING is part of.  There is also an ENCODED
BY without a CONTAINING, which allows identification of an encoding
transformation of the octet string, but I have not seen that used
anywhere yet.) I *think* CONTAINING is supported (and used by the
decoder) in the current OSS Tools, but I am not sure about other tools.

> IOW, assuming I am going to encode X, regardless, do
> both of the constructs in your email produce the same encoding?

Yes.

> Also, you
> say, "now." When was this construct added?

Can't remember when approval took place - some time ago.  The actual
hard-copy ISO publication of the Corrigendum that implemented this is
fairly recent - 2002-05-01.

It is, of course, in the 2002 version text.

John L

> Paul Long
> ipDialog, Inc.
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of John
> > Larmouth
> > Sent: Tuesday, June 25, 2002 3:58 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [ASN.1] TYPE-IDENTIFIER.&Type
> >
> >
> > Yes, but you realise that instead of:
> >
> > y OCTET STRING  -- contains X
> >
> > you can now write
> >
> > y OCTET STRING (CONTAINING X)
> >
> > as formal syntax.
> >
> > John L
> >
> > Paul Long wrote:
> > >
> > > Rajul,
> > >
> > > Okay, thanks. So I think you're answer to my first question is, yes. :-)
> > >
> > > Also, given X:
> > >
> > > X ::= SEQUENCE {
> > >         a INTEGER, -- stuff...
> > >         b BOOLEAN
> > > }
> > >
> > > I believe that Z1:
> > >
> > > Z1 ::= SEQUENCE {
> > >         y TYPE-IDENTIFIER.&Type (X)
> > > }
> > >
> > > encodes in PER exactly like Z2:
> > >
> > > Z2 ::= SEQUENCE {
> > >         y OCTET STRING  -- contains X
> > > }
> > >
> > > True?
> > >
> > > Paul Long
> > > ipDialog, Inc.
> > >
> > > > -----Original Message-----
> > > > From: Rajul Gupta [mailto:[EMAIL PROTECTED]]
> > > > Sent: Monday, June 24, 2002 4:13 PM
> > > > To: [EMAIL PROTECTED]
> > > > Cc: [EMAIL PROTECTED]
> > > > Subject: Re: [ASN.1] TYPE-IDENTIFIER.&Type
> > > >
> > > >
> > > > Hi Paul,
> > > >
> > > > (X) is a type constraints here, and it says that "y" MUST be
> > of type "X"
> > > > only. Syntactically, this is equivalent to
> > > >
> > > > Z ::= SEQUENCE {
> > > >        y       X
> > > > }
> > > >
> > > > However, this kind of syntax (your syntax) is useful in case
> > of PER. PER
> > > > always doesn't have length encoded, but while encoding open
> > > > types, PER puts
> > > > a length wrapper also. So if you are using PER, then at the
> > decoding side
> > > > you can easily find out the length of encoded open type value, without
> > > > knowing it's type.
> > > >
> > > > Usually this type of construct is useful for security fields.
> > Using length
> > > > wrapper you can easily find out the length of security data
> > and leave this
> > > > data unwrapped and unprocessed in your application, and pass
> > it to other
> > > > application or function, where this security data is used.
> > > >
> > > > I hope this answer could be helpful for you.
> > > >
> > > > Rajul
> > > >
> > > > > I've put it off too long. Now it's time for me learn this
> > ".&" stuff. Is
> > > > y,
> > > > > below, encoded in PER as an open type that contains an
> > encoding of X? Is
> > > > > that all there is to it?
> > > > > Also, what syntactical role does the "(X)" play? Is
> > > > > this a constraint and otherwise y could be encoded as an open
> > > > type of any
> > > > > type?
> > > > > X ::= SEQUENCE {
> > > > > a INTEGER, -- stuff...
> > > > > b BOOLEAN
> > > > > }
> > > > >
> > > > > Z ::= SEQUENCE {
> > > > > y TYPE-IDENTIFIER.&Type (X)
> > > > > }
> > > > >
> > > > > Paul Long
> > > > > ipDialog, Inc.
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> >
> > --
> >    Prof John Larmouth
> >    Larmouth T&PDS Ltd
> >    (Training and Protocol Development Services)
> >    1 Blueberry Road
> >    Bowdon                               [EMAIL PROTECTED]
> >    Cheshire WA14 3LS                    Tel: +44 161 928 1605
> >    England                            Fax: +44 161 928 8069

-- 
   Prof John Larmouth
   Larmouth T&PDS Ltd
   (Training and Protocol Development Services)
   1 Blueberry Road                     
   Bowdon                               [EMAIL PROTECTED]
   Cheshire WA14 3LS                    Tel: +44 161 928 1605
   England                              Fax: +44 161 928 8069

Reply via email to