ASN.1 defines data in terms of types. There are ASN.1 defined basic types that describe both simple data items, and constructed data items. By using these types as a foundation, ASN.1 allows the definition of user types. By combining data components of various types to form a new data type, complex data structures can be described.
The basic instrument of definition in the ASN.1 language is the type assignment. This lets the programmer specify the name of a user type, and assign to that name one of the ASN.1 basic types (or perhaps another user defined type). If the type assigned is an ASN.1 constructed type, the definition is expanded to describe each of the components that comprise the structure. The constructed types are as follows:
If a type is defined as a SEQUENCE (for example), then the components that comprise that sequence are listed as part of the type assignment. Each component in the constructed type is identified by a component name and its type.
A similarly useful type which is normally constructed is the type CHOICE which allows the definition of a number of alternate data components, one of which is chosen to complete an instance of data within a larger data structure.
As well as these five types there are a number of simple types, including INTEGER, BOOLEAN and various character string types. These are introduced later.
Type definitions can be reused to describe the underlying characteristics of different data items. For example, a data component named errorCount and another named dayOfWeek can both be defined as INTEGER, although they should not be confused by a programmer. Hence it is not the type that is significant in referring to the data items, but rather the component names.
| Copyright © 2008 CA. All rights reserved. |
|