4 classes of types are distinguished. The class is encoded
in bits 8 and 7 of the first octet of the identifier.
#table1595#
Table: Identifier Classes
-
universal
apply across all applications - basic types defined in ASN.1
-
application-wide
local to a specific application but global within that application.
-
Context-Specific
within a restricted context of the application, e.g. tags within a set or
sequence.
-
Private-Use
arbitrary identifiers chosen by the ;SPM_quot;user;SPM_quot;.
-
Identifier Forms
Two forms of Identifier are distinguished by bit 6 of the
First Identifier Octet:
verbatim58
-
Primitive
The element is atomic.
-
Constructor
The element has contents - one or more
primitive or constructor elements.
-
Identifier Codes
The last five bits (bits 5 to 1) of the first Identifier
Octet and any extension Octets are used to construct the ID
code of the element.
-
Within 1 Octet up to 30 identifiers may be defined.
-
Further identifiers are formed with Extension Octets.
The construction of extension octets is by the following
rules:
-
Bits 5-1 of Octet 1 are all set to 1.
-
Each extension Octet encodes the remaining binary
value, the last Octet having bit 8 clear.
-
Thus bits 7-1 of all extension octets
plus bits 7-1 of the last octet are concatenated to form
one bitfield encoding the unsigned binary integer ID
code.
-
The ID code is formed from the shortest number of
Octets possible: no leading extension octets can have
bit 8 clear.
Valid ID Code octets will take the form:
verbatim59
The Length specifies the length in octets of the contents of
the element. It is itself variable in length, taking 3
forms shown in table #tbt71#1609>.
#table1610#
Table: Length encodings
The Interpretation of the contents field depends upon the ID
Code and any context dependency implied by the ASN.1
specification. Octets are sequenced exactly as the ASN.1
order implies: linear order of items in a specification
occupy successive Octets of the contents.
-
Read the ASN.1 spec from top to bottom!
-
Read each item from left to right!