Information technology — Abstract Syntax Notation One (ASN.1) — Part 1: Specification of basic notation

This document provides a standard notation called Abstract Syntax Notation One (ASN.1) that is used for the definition of data types, values, and constraints on data types. This document: – defines a number of simple types, with their tags, and specifies a notation for referencing these types and for specifying values of these types; – defines mechanisms for constructing new types from more basic types, and specifies a notation for defining such types and assigning them tags, and for specifying values of these types; – defines character sets (by reference to other Recommendations and/or International Standards) for use within ASN.1. The ASN.1 notation can be applied whenever it is necessary to define the abstract syntax of information. The ASN.1 notation is referenced by other standards which define encoding rules for the ASN.1 types.

Technologies de l'information — Notation de syntaxe abstraite numéro un (ASN.1) — Partie 1: Spécification de la notation de base

General Information

Status
Published
Publication Date
29-Jun-2021
Current Stage
6060 - International Standard published
Start Date
30-Jun-2021
Due Date
02-Jul-2023
Completion Date
30-Jun-2021
Ref Project

Relations

Standard
ISO/IEC 8824-1:2021 - Information technology — Abstract Syntax Notation One (ASN.1) — Part 1: Specification of basic notation Released:6/30/2021
English language
181 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)


INTERNATIONAL ISO/IEC
STANDARD 8824-1
Sixth edition
2021-06
Information technology — Abstract
Syntax Notation One (ASN.1) —
Part 1:
Specification of basic notation
Technologies de l'information — Notation de syntaxe abstraite
numéro un (ASN.1) —
Partie 1: Spécification de la notation de base
Reference number
©
ISO/IEC 2021
© ISO/IEC 2021
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting
on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address
below or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
ii © ISO/IEC 2021 – All rights reserved

Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are
members of ISO or IEC participate in the development of International Standards through technical
committees established by the respective organization to deal with particular fields of technical activity.
ISO and IEC technical committees collaborate in fields of mutual interest. Other international
organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the
work.
The procedures used to develop this document and those intended for its further maintenance are
described in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for
the different types of document should be noted. This document was drafted in accordance with the
editorial rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives or
www.iec.ch/members_experts/refdocs)
Attention is drawn to the possibility that some of the elements of this document may be the subject of
patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. Details
of any patent rights identified during the development of the document will be in the Introduction and/or
on the ISO list of patent declarations received (see www.iso.org/patents) or the IEC list of patent
declarations received (see patents.iec.ch).
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and
expressions related to conformity assessment, as well as information about ISO's adherence to the
World Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT)
see www.iso.org/iso/foreword.html. In the IEC, see www.iec.ch/understanding-standards.
This document was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 6, Telecommunications and information exchange between systems, in collaboration
with ITU-T. The identical text is published as ITU-T X.680 (02/2021).
This sixth edition cancels and replaces the fifth edition (ISO/IEC 8824-1:2015), which has been
technically revised. It also incorporates ISO/IEC 8824-1:2015/Amd 1:2019, ISO/IEC 8824-1:2015/
Cor 1:2017, ISO/IEC 8824-1:2015/Cor 2:2018, ISO/IEC 8824-1:2015/Cor 3:2018.
A list of all parts in the ISO/IEC 8824 series can be found on the ISO and IEC websites.
Any feedback or questions on this document should be directed to the user’s national standards body. A
complete listing of these bodies can be found at www.iso.org/members.html and www.iec.ch/national-
committees.
© ISO/IEC 2021 – All rights reserved iii

CONTENTS
Page
Introduction . viii
1 Scope . 1
2 Normative references . 1
2.1 Identical Recommendations | International Standards . 1
2.2 Additional references . 2
3 Definitions . 2
3.1 International Object Identifier tree specification . 2
3.2 Information object specification . 2
3.3 Constraint specification . 3
3.4 Parameterization of ASN.1 specification . 3
3.5 Structure for identification of organizations . 3
3.6 Universal Multiple-Octet Coded Character Set (UCS) . 3
3.7 Representation of dates and times . 3
3.8 Additional definitions . 4
4 Abbreviations . 9
5 Notation . 9
5.1 General . 9
5.2 Productions . 10
5.3 The alternative collections . 10
5.4 Non-spacing indicator . 10
5.5 Example of a production . 10
5.6 Layout . 10
5.7 Recursion . 11
5.8 References to permitted sequences of lexical items . 11
5.9 References to a lexical item . 11
5.10 Short-hand notations . 11
5.11 Value references and the typing of values . 12
6 The ASN.1 model of type extension . 12
7 Extensibility requirements on encoding rules . 12
8 Tags . 13
9 Encoding instructions . 14
10 Use of the ASN.1 notation . 15
11 The ASN.1 character set . 15
12 ASN.1 lexical items . 16
12.1 General rules . 16
12.2 Type references . 17
12.3 Identifiers . 17
12.4 Value references . 17
12.5 Module references . 17
12.6 Comments . 17
12.7 Empty lexical item . 18
12.8 Numbers . 18
12.9 Real numbers . 18
12.10 Binary strings . 18
12.11 XML binary string item . 18
12.12 Hexadecimal strings . 18
12.13 XML hexadecimal string item . 19
12.14 Character strings. 19
12.15 XML character string item . 20
12.16 The simple character string lexical item . 22
Rec. ITU-T X.680 (02/2021) iii
© ISO/IEC 2021 – All rights reserved

12.17 Time value character strings . 22
12.18 XML time value character string item . 22
12.19 The property and setting names lexical item . 22
12.20 Assignment lexical item . 22
12.21 Range separator . 22
12.22 Ellipsis . 22
12.23 Left version brackets . 23
12.24 Right version brackets . 23
12.25 Encoding references . 23
12.26 Integer-valued Unicode labels . 23
12.27 Non-integer Unicode labels . 23
12.28 XML end tag start item . 23
12.29 XML single tag end item . 23
12.30 XML boolean true item . 23
12.31 XML boolean extended-true item . 24
12.32 XML boolean false item . 24
12.33 XML boolean extended-false item . 24
12.34 XML real not-a-number item . 24
12.35 XML real infinity item . 24
12.36 XML tag names for ASN.1 types . 25
12.37 Single character lexical items . 26
12.38 Reserved words . 26
13 Module definition . 27
14 Referencing type and value definitions . 31
15 Notation to support references to ASN.1 components . 32
16 Assigning types and values . 33
17 Definition of types and values . 35
18 Notation for the boolean type . 38
19 Notation for the integer type . 38
20 Notation for the enumerated type . 39
21 Notation for the real type . 41
22 Notation for the bitstring type . 42
23 Notation for the octetstring type . 44
24 Notation for the null type . 44
25 Notation for sequence types . 45
26 Notation for sequence-of types . 48
27 Notation for set types . 50
28 Notation for set-of types . 51
29 Notation for choice types . 52
30 Notation for selection types . 54
31 Notation for prefixed types . 54
31.1 General . 54
31.2 The tagged type . 55
31.3 The encoding prefixed type . 55
32 Notation for the object identifier type . 56
33 Notation for the relative object identifier type . 58
34 Notation for the OID internationalized resource identifier type . 59
35 Notation for the relative OID internationalized resource identifier type . 60
36 Notation for the embedded-pdv type . 60
37 Notation for the external type . 62
iv Rec. ITU-T X.680 (02/2021)
© ISO/IEC 2021 – All rights reserved

38 The time type . 63
38.1 General . 63
38.2 Time properties and settings of time abstract values . 63
38.3 Basic value notation and XML value notation for time abstract values with specified property
settings . 67
38.4 Useful time types . 71
39 The character string types . 72
40 Notation for character string types . 73
41 Definition of restricted character string types . 73
42 Naming characters, collections and property category sets . 77
43 Canonical order of characters . 81
44 Definition of unrestricted character string types . 82
45 Notation for types defined in clauses 46 to 48 . 83
46 Generalized time . 83
47 Universal time . 84
48 The object descriptor type . 85
49 Constrained types . 86
50 Element set specification . 87
51 Subtype elements . 89
51.1 General . 89
51.2 Single value . 90
51.3 Contained subtype . 90
51.4 Value range . 90
51.5 Size constraint . 91
51.6 Type constraint . 91
51.7 Permitted alphabet . 91
51.8 Inner subtyping. 92
51.9 Pattern constraint . 93
51.10 Property settings . 93
51.11 Duration range . 94
51.12 Time point range . 95
51.13 Recurrence range . 95
52 The extension marker . 95
53 The exception identifier . 97
54 Encoding control sections . 98
A.1 Definition . 99
A.2 Metacharacters . 99
B.1 General . 103
B.2 The ASN.1 defined time types module . 103
C.1 The need for the value mapping concept (tutorial introduction) . 108
C.2 Value mappings . 110
C.3 Identical type definitions . 111
C.4 Specification of value mappings . 113
C.5 Additional value mappings defined for the character string types . 113
C.6 Specific type and value compatibility requirements . 114
C.7 Examples . 115
C.7.2 Example 1 . 115
C.7.3 Example 2 . 115
C.7.4 Example 3 . 115
C.7.5 Example 4 . 115
C.7.6 Example 5 . 115
C.7.7 Example 6 . 116
Rec. ITU-T X.680 (02/2021) v
© ISO/IEC 2021 – All rights reserved

D.1 Values assigned in this Recommendation | International Standard . 117
D.2 Object identifiers in the ASN.1 and encoding rules standards . 117
F.1 General . 120
F.2 Use of the International Object Identifier tree by the object identifier (OBJECT IDENTIFIER)
type . 120
F.3 Use of the International Object Identifier tree by the OID internationalized resource identifier
(OID-IRI) type . 120
G.1 Example of a personnel record . 121
G.1.1 Informal description of Personnel Record . 121
G.1.2 ASN.1 description of the record structure . 121
G.1.3 ASN.1 description of a record value . 122
G.2 Guidelines for use of the notation . 122
G.2.1 Boolean . 123
G.2.2 Integer . 123
G.2.3 Enumerated . 123
G.2.4 Real . 124
G.2.5 Bit string . 124
G.2.6 Octet string . 126
G.2.7 UniversalString, BMPString and UTF8String . 126
G.2.8 CHARACTER STRING . 127
G.2.9 Null . 128
G.2.10 Sequence and sequence-of . 128
G.2.11 Set and set-of . 130
G.2.12 Tagged . 132
G.2.13 Choice . 133
G.2.14 Selection type . 135
G.2.16 Embedded-pdv . 136
G.2.17 External . 136
G.2.18 Instance-of . 136
G.2.19 Object identifier . 137
G.2.20 OID internationalized resource identifier . 137
G.2.21 Relative object identifier . 137
G.3 Value notation and property settings (TIME type and useful time types) . 137
G.3.1 Date . 137
G.3.2 Time of day . 138
G.3.3 Date and time of day . 138
G.3.4 Time interval . 139
G.3.5 Recurring interval . 140
G.4 Identifying abstract syntaxes . 140
G.5 Subtypes . 141
H.1 Character string support in ASN.1 . 145
H.2 The UniversalString, UTF8String and BMPString types . 145
H.3 On ISO/IEC 10646 conformance requirements . 146
H.4 Recommendations for ASN.1 users on ISO/IEC 10646 conformance . 146
H.5 Adopted subsets as parameters of the abstract syntax . 147
H.6 The CHARACTER STRING type . 147
I.1 Overview . 148
I.2 Meaning of version numbers . 149
I.3 Requirements on encoding rules . 150
I.4 Combination of (possibly extensible) constraints . 150
I.4.1 Model . 150
I.4.2 Serial application of constraints . 150
I.4.3 Use of set arithmetic . 151
I.4.4 Use of the Contained Subtype notation . 152
J.1 The collections of ASN.1 types for times and dates. 153
J.2 ISO 8601 key concepts . 153
J.3 Abstract values of the TIME type . 154
J.4 Time properties of the time abstract values . 155
J.5 Value notation . 155
vi Rec. ITU-T X.680 (02/2021)
© ISO/IEC 2021 – All rights reserved

J.6 Use of the ASN.1 subtype notation . 156
J.7 The property settings subtype notation . 156
K.1 General . 158
K.2 Analyzing the full string . 158
K.3 Analysis of a string containing an interval . 159
K.4 Analysis of a string containing a date . 159
K.5 Analysis of a string containing a year . 160
K.6 Analysis of a string containing a century . 160
K.7 Analysis of a string containing a time . 160
K.8 Analysis of a string containing a simple time . 161
Rec. ITU-T X.680 (02/2021) vii
© ISO/IEC 2021 – All rights reserved

Introduction
This Recommendation | International Standard presents a standard notation for the definition of data types and values.
A data type (or type for short) is a category of information (for example, numeric, textual, still image or video
information). A data value (or value for short) is an instance of such a type. This Recommendation | International
Standard defines several basic types and their corresponding values, and rules for combining them into more complex
types and values.
In some protocol architectures, each message is specified as the binary value of a sequence of octets. However,
standards-writers need to define quite complex data types to carry their messages, without concern for their binary
representation. In order to specify these data types, they require a notation that does not necessarily determine the
representation of each value. ASN.1 is such a notation. This notation is supplemented by the specification of one or
more algorithms called encoding rules that determine the value of the octets that carry the application semantics (called
the transfer syntax). Rec. ITU-T X.690 | ISO/IEC 8825-1, Rec. ITU-T X.691 | ISO/IEC 8825-2 and Rec. ITU-T X.693 |
ISO/IEC 8825-4 specify three families of standardized encoding rules, called Basic Encoding Rules (BER), Packed
Encoding Rules (PER), and XML Encoding Rules (XER).
Some users wish to redefine their legacy protocols using ASN.1, but cannot use standardized encoding rules because
they need to retain their existing binary representations. Other users wish to have more complete control over the exact
layout of the bits on the wire (the transfer syntax). These requirements are addressed by Rec. ITU-T X.692 |
ISO/IEC 8825-3 which specifies an Encoding Control Notation (ECN) for ASN.1. ECN enables designers to formally
specify the abstract syntax of a protocol using ASN.1, but to then (if they so wish) take complete or partial control of
the bits on the wire by writing an accompanying ECN specification (which may reference standardized Encoding Rules
for some parts of the encoding).
A very general technique for defining a complicated type at the abstract level is to define a small number of simple
types by defining all possible values of the simple types, then combining these simple types in various ways. Some of
the ways of defining new types are as follows:
a) given an (ordered) list of existing types, a value can be formed as an (ordered) sequence of values, one
from each of the existing types; the collection of all possible values obtained in this way is a new type (if
the existing types in the list are all distinct, this mechanism can be extended to allow omission of some
values from the list);
b) given an unordered set of (distinct) existing types, a value can be formed as an (unordered) set of values,
one from each of the existing types; the collection of all possible unordered sets of values obtained in this
way is a new type (the mechanism can again be extended to allow omission of some values);
c) given a single existing type, a value can be formed as an (ordered) list or (unordered) set of zero, one or
more values of the existing type; the collection of all possible lists or sets of values obtained in this way
is a new type;
d) given a list of (distinct) types, a value can be chosen from any one of them; the set of all possible values
obtained in this way is a new type;
e) given a type, a new type can be formed as a subset of it by using some structure or order relationship
among the values.
An important aspect of combining types in this way is that encoding rules should recognize the combining constructs,
providing unambiguous encodings of the collection of values of the basic types. Thus, every basic type defined using
the notation specified in this Recommendation | International Standard is assigned a tag to aid in the unambiguous
encoding of values.
Tags are mainly intended for machine use, and are not essential for the human notation defined in this Recommendation
| International Standard. Where, however, it is necessary to require that certain types be distinct, this is expressed by
requiring that they have distinct tags. The allocation of tags is therefore an important part of the use of this notation, but
(since 1994) it is possible to specify the automatic allocation of tags.
NOTE 1 – Within this Recommendation | International Standard, tag values are assigned to all simple types and construction
mechanisms. The restrictions placed on the use of the notation ensure that tags can be used in transfer for unambiguous
identification of values.
It is also possible to assign encoding instructions to a type in order to affect the encoding of that type. This can be done
either by a type prefix placed before a type definition or use of a type reference, or by an encoding control section
placed at the end of an ASN.1 module. The generic syntax of type prefixes and encoding control sections is specified in
this Recommendation | International Standard, and includes an encoding reference to identify the encoding rules that are
modified by the encoding instruction. The semantics and detailed syntax of encoding instructions are specified in the
encoding rules Recommendation | International Standard identified by the encoding reference.
viii Rec. ITU-T X.680 (02/2021)
© ISO/IEC 2021 – All rights reserved

An ASN.1 specification will initially be produced with a set of fully defined ASN.1 types. At a later stage, however, it
may be necessary to change those types (usually by the addition of extra components in a sequence or set type). If this is
to be possible in such a way that implementations using the old type definitions can interwork with implementations
using the new type definitions in a defined way, encoding rules need to provide appropriate support. The ASN.1
notation supports the inclusion of an extension marker on a number of types. This signals to encoding rules the intention
of the designer that this type is one of a series of related types (i.e., versions of the same initial type) called an extension
series, and that the encoding rules are required to enable information transfer between implementations using different
types that are related by being part of the same extension series.
Clauses 11 to 33 (inclusive) define the simple types supported by ASN.1, and specify the notation to be used for
referencing simple types and for defining new types using them. Clauses 11 to 33 also specify notations to be used for
specifyi
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.

Loading comments...