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

Re: re. ASN.1 integers (was Re: proposed certificate format)

cme@cybercash.com (Carl Ellison) wrote:
> I was noting that the *only* INTEGER construct [unless you go the
> additional step to limit its range] is indefinite in length.

Just as when you define "char *" you often don't mean that the string
is indefinite in length, with plain INTEGER applications typically do
not mean that its values are indefinite in length.  Just as you could
add a comment that a "char *" is 20 bytes long, say, is the same way
that applications can limit the size of integers.  For example, if you
want explicit notation for 16-bit integers or 32-bit integers, you an
simply write

        Int16 ::= INTEGER (-32768..32767)
        Int32 ::= INTEGER (-2147483648..2147483647)

then use Int16 and Int32 wherever you want to define integer types
with these ranges.  It really is not complex.

Bancroft Scott