> ASN1 BER representation of INTEGER 1 is             02 01 01
> ASN1 BER representation of INTEGER -255 is also  02 01 01
>
> When I write my decoding algorithm, how do I know if the value is 1 or -255?

The value is encoded in two's complement. The possible values that would
fit into a single octet range from -128 to 127. The sign is in the first
bit.

It would appear you have downloaded neither the ASN.1 standards now
one of the two ASN.1 reference books (free from www.oss.com). You're going
to need something besides trial and error  if you expect to write your own
decoder.

=====================================================================
Conrad Sigona                         Toll Free      : 1-888-OSS-ASN1
OSS Nokalva                           Voice Mail     : 1-732-302-9669 x400
[EMAIL PROTECTED]                        Fax            : 1-419-831-5035
http://www.oss.com                    My direct line : 1-315-845-1773

Reply via email to