On Fri, 17 Nov 2000 [EMAIL PROTECTED] wrote:

> HI All,
>      Can anyone guide me about the range to be considered for the following
> element
> 
> x  ::=  INTEGER ( 0 | 15 .. 269)
> 
> 
> will it be
> 269 -15 = 254 +1 = 255
> 
> and a range for value 0 .
> so range = 255 +1 = 256
> so this will encode in a octet aligned 8 bits
> 
> or
> 
> should the range be taken as
> 269 - 0 =269 +1 =270
> this will encode in octet aligned 16 bits

Assuming that you are talking about PER ALIGNED, the latter; see X.691
10.5.3 and 10.5.7.3.  If you are talking about PER UNALIGNED, neither; see
X.691 10.5.3 and 10.5.6.

Then again, you might want to use a high quality ASN.1 toolkit such
as the OSS ASN.1 Tools for Java, C or C++ which supports ASN.1:1997
and BER, DER and PER (both ALIGNED and UNALIGNED!).  This allows you
to get to market faster by your not needing to master the intricacies
of ASN.1 and PER.

If you nonetheless choose to implement your own PER encoder/decoder then
you would benefit greatly by using the OSS ASN-1Step tool.  It is an
all-in-one compiler and encoder/decoder that has a powerful PER diagnostic
tool built-in.  This very easy to use tool shows you in detail exactly how
PER encodings are constructed, and allows you to immediately determine if
the encodings that you are generating are valid ones.

-------------------------------------------------------------------------
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

Reply via email to