[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: asnInt to store more bytes



Aruna,
 
In our projects, we've worked around this SNACC limitation by changing the ASN.1 syntax and using OCTET STRING rather than INTEGER, as in the following example.  Note that the use of the [UNIVERSAL 2] tag is supported by the SNACC compiler, but is strictly speaking, not valid ASN.1 syntax, and may be rejected by other compilers.
 
MySequence ::= SEQUENCE
{
   myFlag      BOOLEAN,
   myLargeInt  LargeInteger -- was INTEGER
}
 
LargeInteger ::= [UNIVERSAL 2] IMPLICIT OCTET STRING
 
Also note that the code setting the OCTET STRING for large integers must ensure it is correctly encoded per X.690 (essentially a two's complement binary number encoded in the smallest possible number of octets).  For example, the value -1 is encoded as 0xFF, not 0xFFFFFFFF, and the value 1 is encoded as 0x01, not 0x00000001.
 
- Rich

----------------------------------
Richard E. Nicholas
Secure Systems Consultant
BAE Systems Information Technology
Richard.Nicholas@xxxxxxxxxxxxxxxxx


From: owner-imc-snacc@xxxxxxxxxxxx [mailto:owner-imc-snacc@xxxxxxxxxxxx] On Behalf Of aruna.pradeepa@xxxxxxxxx
Sent: Wednesday, June 14, 2006 12:05 AM
To: imc-snacc@xxxxxxx
Subject: asnInt to store more bytes

Hi All,

 

In c language, asnInt datatype I have a requirement to store more bytes(> 4 bytes).

 

Could any of you help me how should I solve this problem.

 

Thanks,
Aruna