ASN.1 Types.
ASN.1 introduces standard mechanizm of building up complex types. Simple
types are used as atoms to buid more complex structured types. And as mentioned
before, there are some useful biult-in types.
Simple types
Simple types are intended to be a ultimate basis for any complex type
design. They comprise types for representing numerical information (integer,
real), finite sets of values (null, boolean, enumerated), transparent data
(bit string, octet string), string of characters from various character
sets and object indentifiers. Each type has both type and value notation,
in which simple type keyword consist of one or two words spelling out the
name in English. So here are they:
- INTEGER for any numerical whole-number
information
- REAL that funny numbers with mantissa
and exponent
- NULL very special type, has only one
value which even means (freely) nothing
- BOOLEAN better than null, has two
values (wow!) used for logic - true and false
- ENUMERATED much more better than
null - give as many values as you want to
- BIT STRING forget all that
stupid bytes and words, make your special one
- OCTET STRING but sometimes,
bytes are also useful, but I can't remember what is it for
- OBJECT IDENTIFIER for that
annoing numbers from ISO
The type notation for each character string type is a predefined type
reference as for the useful types. These types simply spell out the name
of character set in English:
- NumericString contain just numbers 0-9 and single space
- PrintableString letters a-z, A-Z, numbers 0-9, space and characters
'"()+,-./:=? ufff
- TeletexString (or T61String) by CCITT T.61, still haven't
got one?
- VideotexString (or ISO646String) by CCITT T.100 and T.101
- VisibleString only visible characters of IA5 (ASCII international
version)
- IA5String complete set of IA5
- GraphicString ISO registered graphic characters and unregistered
space
- GeneralString registered graphic and control characters plus
space and delete
Here you can find some examples about
using character string types.
Structured types
Structured types are based on simple types or any subtype derived from
them. The term for a single entity of a structure is component.
The number of possible structured types is infinite, althoug there is just
small finite set of operations to construct them. There are structured
types constructed by simple collecting components of the same or different
types, these collection can be ordered or not. Then there are structured
types constructed by choosing from finite set of components. And, last
but not least, special type representing any type. Here are the keywords,
as usual spelling out their function in English:
- SET - a collection of distinct
type components
- SEQUENCE - ordered collection of
distinct type components
- SET OF - like SET, but components
are of the same type
- SEQUENCE OF - similarly to SET
OF, ordered collection of components of the same type
- CHOICE - a collection of alternatives
(no bigamy...)
- ANY - to describe a hole in the specification,
any type can be substituted
- TAGGED - how to assign a type an
unique identifier
Useful types
Useful types are those which can be normally described by ASN.1 syntax,
but they are already defined and available to users because of their general
usefulness.
- Generalized time - textual form of date and time: "YYYYMMDDHHMMSS.SSS"
- UTCTime - universal time "YYMMDDHHMM+HHMM" to express
time differential
- EXTERNAL - to embed a value from another abstract syntax
- Objectdescriptor - textual object description