I'm sorry for the misunderstanding...I used always the word "decoder" but
what I want to know is abount the encoder and about encoding function...
I understood that in the encoded file a structure is recognized as encoded
with indefinite lenght if the tag 80 is found...
But my problem was how to tell to the encoder that a structure has to be
encoded with indefinite lenght and that another structure must be encoded
with definite lenght within the same file.

For example which is the ASN.1 definition for a structure like this:

main_structure (to be encoded in indefinte way)
   field1 octet_string[10] (to be encoded in definite way)
   field2 any_substructure_type (to be encoded in definite way)

Thanks for answers,
Roberto

-----Original Message-----
From: devaraj[IT]
To: [EMAIL PROTECTED]
Sent: 12/09/2002 11.28
Subject: RE: [ASN.1] Abount definite and indefinite lenght encoding

While decoding,if the value of Length of is 10000000 'B (or 80 'H),then
the
value field is contains indefinite length and the same can be idendified
by
end-of-content ( 0x00'H 0x00'H) at the beginning of next TLV
structure.If
the value of length is other than 10000000 'B,then value filed contains
definite length.

regards
kb devaraj

> -----Original Message-----
> From: Pino Roberto [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, September 11, 2002 8:33 PM
> To:   '[EMAIL PROTECTED]'
> Subject:      R: [ASN.1] Abount definite and indefinite lenght
encoding
> 
> Thanks for the answers...
> My second question was "How can I tell to the decoder that a structure
> must
> be encoded with indefinite lenght and that another must be encoded
with
> definite lenght within the same input file? Is there any standard
> identifier
> in the ASN.1 definition of the structure to use?".
> My question was about the ASN1 syntax to say that a structure must be
> encoded with indefinite lenght.
> Thanks,
> Roberto
> 
> -----Messaggio originale-----
> Da: Bancroft Scott [mailto:[EMAIL PROTECTED]]
> Inviato: mercoled� 11 settembre 2002 14.33
> A: '[EMAIL PROTECTED]'
> Oggetto: Re: [ASN.1] Abount definite and indefinite lenght encoding
> 
> 
> On Wed, 11 Sep 2002, Pino Roberto wrote:
> 
> > Hi,
> > I would like to know if it's possible with ASN.1, use different
lenght
> > encodings for structure in the same file.
> > For example, is possible encoding a structure with indefinite lenght
> > encoding and another (may be a substructure of the first one) with
> definite
> > lenght encoding?
> 
> Yes, with BER the encoder is free to choose either definite or
indefinite
> length encodings.  Of course, if an application profile dictates that
> only one or the other must be used, then you are obliged to use the
> specified one.
> 
> > And if it's possibile, how can the encoder recognize structures to
be
> > encoded with definite lenght encoding from structures with
indefinite
> > lenght encoding? Is there any ASN.1 tag to use? Thanks, bye, Roberto
> 
> I take it that you meant to say "how can the decoder ...".  Yes?
> 
> If yes, it can tell whether definite or indefinite length encoding was
> used based on whether the length field has a value of hex 80.
> 
> If no, check with the provider of the tool that you are using.
> 
>
------------------------------------------------------------------------
-
> 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