### ASN.1 Types

ASN.1 is similar to a high-level programming language. Unlike other high-level languages, ASN.1 has no executable statements. It includes only language constructs required to define types and values.

ASN.1 defines a number of built-in types. Users of ASN.1 can then define their own types based on the built-in types provided by the language. The ASN.1 standard defines four categories of types that are commonly used in defining application interfaces such as XOM and XDS:

· ASN.1 Simple Types

· ASN.1 Useful Types

· ASN.1 Character String Types

· ASN.1 Type Constructors

ASN.1 simple types are Bit String, Boolean, Integer, Null, Object Identifier, Octet String, and Real. The following table shows the relationship of OM syntaxes (syntaxes defined in XOM API) to ASN.1 simple types. (Refer to Information Syntaxes for the complete set of tables for the four categories of ASN.1 types.) As shown in the table, for every ASN.1 type except Real, there is an OM syntax that is functionally equivalent to it. The simple types are listed in the first column of the table; the corresponding syntaxes are listed in the second column.

Syntax for the Simple ASN.1 Types

ASN.1 Type | OM Syntax
Bit String | String(OM_S_BIT_STRING)
Boolean | OM_S_BOOLEAN
Integer | OM_S_INTEGER
Null | OM_S_NULL
Object Identifier | String(OM_S_OBJECT_IDENTIFIER_STRING)
Octet String | String(OM_S_OCTET_STRING)
Real | None (A future edition of XOM can define a syntax corresponding to this type.)

An example illustrates how OM syntaxes are used to define the syntax of values for various attributes. One of the simplest of the ASN.1 types is Boolean. There are only two possible values for a Boolean type: TRUE and FALSE. The DS_FROM_ENTRY OM attribute of the DS_C_ENTRY_INFO object class has a value syntax of OM_S_BOOLEAN. OM_S_BOOLEAN is the C language representation for the OM syntax that corresponds to the ASN.1 Boolean type. The value of the DS_FROM_ENTRY OM attribute indicates whether information from the directory was extracted from the specified object's entry (TRUE), or from a copy of the entry (FALSE). The actual C language definition for OM_S_BOOLEAN is made in the XOM API header file xom.h.

###