
Large Integer Support
The maximum size for a Java long integer type is 64 bits. ASN.1 has no such limitation on integer sizes and some applications (security key values for example) demand larger sizes. In order to accommodate these types of applications, the ASN1C compiler allows an integer to be declared a "big integer" via a configuration file variable (the <isBigInteger/> setting is used to do this - see the section describing the configuration file for full details). When the compiler detects this setting, it will declare the integer class to be derived from the Asn1BigInteger class instead of the Asn1Integer class. The Asn1BigInteger class encapsulates an object of the Java BigInteger class. This provides full support for working with integers of arbitrary lengths.
SecurityKeyType ::= [APPLICATION 2] INTEGERThen, in a configuration file used with the ASN.1 definition above, the following declaration can be made:
<production> <name>SecurityKeyType</name> <isBigInteger/> </production>class SecurityKeyType extends Asn1BigInteger
Objective Systems, Inc.102 Pickering Way, Suite #506Exton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |