Information technology — Abstract Syntax Notation One (ASN.1) — Part 3: Constraint specification

This document is part of Abstract Syntax Notation One (ASN.1) and provides notation for specifying user-defined constraints, table constraints, and contents constraints.

Technologies de l'information — Notation de syntaxe abstraite numéro un (ASN.1) — Partie 3: Spécification des contraintes

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

Buy Standard

Standard
ISO/IEC 8824-3:2021 - Information technology -- Abstract Syntax Notation One (ASN.1)
English language
10 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)

INTERNATIONAL ISO/IEC
STANDARD 8824-3
Sixth edition
2021-06
Information technology — Abstract
Syntax Notation One (ASN.1) —
Part 3:
Constraint specification
Technologies de l'information — Notation de syntaxe abstraite
numéro un (ASN.1) —
Partie 3: Spécification des contraintes
Reference number
ISO/IEC 8824-3:2021(E)
©
ISO/IEC 2021

---------------------- Page: 1 ----------------------
ISO/IEC 8824-3:2021(E)

COPYRIGHT PROTECTED DOCUMENT
© 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

---------------------- Page: 2 ----------------------
ISO/IEC 8824-3:2021(E)
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.682 (02/2021).
This sixth edition cancels and replaces the fifth edition (ISO/IEC 8824-3:2015), which has been
technically revised. It also incorporates ISO/IEC 8824-3:2015/Cor 1:2018 and ISO/IEC 8824-3:2015/
Cor 2: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

---------------------- Page: 3 ----------------------
ISO/IEC 8824-3:2021(E)

CONTENTS
Page
Introduction . iv
1 Scope . 1
2 Normative references . 1
3 Definitions . 1
4 Abbreviations . 2
5 Convention . 2
6 Notation . 2
7 ASN.1 lexical items . 2
8 General constraint specification . 2
9 User-defined constraints . 3
10 Table constraints, including component relation constraints . 4
11 Contents constraints . 7
A.4 Example . 8

 Rec. ITU-T X.682 (02/2021) iii
© ISO/IEC 2021 – All rights reserved

---------------------- Page: 4 ----------------------
ISO/IEC 8824-3:2021(E)
Introduction
Application designers require a notation to define a structured data type to convey their semantics. This is provided in
Rec. ITU-T X.680 | ISO/IEC 8824-1 and Rec. ITU-T X.681 | ISO/IEC 8824-2. A notation is also required to further
constrain the values that can appear. Examples of such constraints are restricting the range of some component(s), or
using a specified information object set to constrain an "ObjectClassFieldType" component, or using the "AtNotation" to
specify a relation between components.
This Recommendation | International Standard provides the notation for the general case of constraint specification.
NOTE 1 – For historical reasons the special case of a "subtype constraint" is specified in Rec. ITU-T X.680 | ISO/IEC 8824-1.
Constraint notation can appear (in round brackets) after any use of the syntactic construct "Type", and the purpose of this
Recommendation | International Standard is to specify the general case of what goes in the round brackets.
NOTE 2 – Multiple constraints (each inside its own round brackets) can be applied to the same "Type", as the result of constraining
a "Type" is itself formally a "Type" construct.
When a constraint is applied to the textually outermost use of a "Type" construct, it results in the creation of a new type
which is a subtype of the original (parent) type.
A subtype of a parent type can itself be used in defining other subtypes of the same parent type in other uses of the
constraint notation. Thus the subset of values constituting a subtype can be defined either by limiting the range of the
parent type, or by specifying the subtype as a union of sets of values.
NOTE 3 – The "ValueSet" notation specified in Rec. ITU-T X.680 | ISO/IEC 8824-1, 16.7, provides a further means of specifying
a subtype.
Constraints may also be used to produce a subtype of a parent type (as described above) when the notation is embedded
within another type. However, some "component relation" constraints are textually included following a "Type"
(within a set or sequence type definition), but are not used to restrict the set of possible values of the "Type" which they
follow (the referencing component). Rather, they specify a relation between the value of the referencing component and
the value of one or more other "Type"s in the same set or sequence type (called the referenced components).
Component relation constraints can be seen as subtyping the sequence type within which they are embedded, but not
necessarily the referencing type.
A constraint on an "ObjectClassFieldType" component can be applied by restricting the type or values in the component
by using an information object set. Such constraints are called table constraints, since they are specified in terms of the
"associated table" of the object set. The component relation constraints defined in this Recommendation | International
Standard are a special case of table constraints.
Finally, a "Type" may be subtyped by specifying the set of values in the subtype by human-readable text. Such a constraint
is called a user-defined constraint. For example, a user-defined constraint can be specified to constrain a BIT STRING to
the set of values produced by the encryption of a value of a specified ASN.1 type.
It is the purpose of this Recommendation | International Standard to provide the notation to be used for specifying table
constraints (including component relation constraints), and user-defined constraints.
NOTE 4 – In general, full support for the specification of constraints in a flexible way (particularly component relation constraints,
subtyping constraints, and user-defined constraints with a formally defined body) would require notation with a power comparable
to that of programming languages. Such power can only be sensibly provided by the establishment of links from the ASN.1 notation
into some other defined computer language. This version of this Recommendation | International Standard does not provide such
links, and hence supports only a small number of constraining mechanisms.
While the embedding of notation defining constraints (subtypes and relationships) will frequently be the most convenient
form of specification (particularly for the simple subtyping of primitive components of structures), separate (external)
specification will sometimes be preferred, particularly where the constraints are being imposed by a separate group from
that which defined the basic protocol.
NOTE 5 – The parameterization defined in Rec. ITU-T X.683 | ISO/IEC 8824-4 is specifically designed to enable a piece of ASN.1
specification (and in particular, a constraint) to be parameterized, allowing the actual constraint to be imposed by some other group
that provides actual parameters for the parameterized construct.
iv Rec. ITU-T X.682 (02/2021)
© ISO/IEC 2021 – All rights reserved

---------------------- Page: 5 ----------------------
ISO/IEC 8824-3:2021(E)
The notations for constraint specification supported here are:
– user-defined constraints (see clause 9);
– table constraints, including component relation constraints between two components which are
carrying values related to an information object, defined using the notation of Rec. ITU-T X.681 |
ISO/IEC 8824-2 (see clause 10);
– contents constraints (see clause 11).
The application of table constraints to the "InstanceOfType" construct of Rec. ITU-T X.681 | ISO/IEC 8824-2, Annex C,
is specified in Annex A.

 Rec. ITU-T X.682 (02/2021) v
© ISO/IEC 2021 – All rights reserved

---------------------- Page: 6 ----------------------
ISO/IEC 8824-3:2021 (E)
INTERNATIONAL STANDARD
ITU-T RECOMMENDATION
Information technology –
Abstract Syntax Notation One (ASN.1):
Constraint specification
1 Scope
This Recommendation | International Standard is part of Abstract Syntax Notation One (ASN.1) and provides notation
for specifying user-defined constraints, table constraints, and contents constraints.
2 Normative references
The following Recommendations and International Standards contain provisions which, through reference in this text,
constitute provisions of this Recommendation | International Standard. At the time of publication, the editions indicated
were valid. All Recommendations and Standards are subject to revision, and parties to agreements based on this
Recommendation | International Standard are encouraged to investigate the possibility of applying the most recent edition
of the Recommendations and Standards listed below. Members of IEC and ISO maintain registers of currently valid
International Standards. The Telecommunication Standardization Bureau of the ITU maintains a list of currently valid
ITU-T Recommendations.
2.1 Identical Recommendations | International Standards
– Recommendation ITU-T X.680 (2021) | ISO/IEC 8824-1:2021, Information technology – Abstract Syntax
Notation One (ASN.1): Specification of basic notation.
– Recommendation ITU-T X.681 (2021) | ISO/IEC 8824-2:2021, Information technology – Abstract Syntax
Notation One (ASN.1): Information object specification.
– Recommendation ITU-T X.683 (2021) | ISO/IEC 8824-4:2021, Information technology – Abstract Syntax
Notation One (ASN.1): Parameterization of ASN.1 specifications.
NOTE – The references above shall be interpreted as references to the identified Recommendations | International Standards
together with all their published amendments and technical corrigenda.
3 Definitions
For the purposes of this Recommendation | International Standard, the following definitions apply.
3.1 Specification of basic notation
This Recommendation | International Standard uses the terms defined in Rec. ITU-T X.680 | ISO/IEC 8824-1.
3.2 Information object specification
This Recommendation | International Standard uses the terms defined in Rec. ITU-T X.681 | ISO/IEC 8824-2.
3.3 Parameterization of ASN.1 specification
This Recommendation | International Standard uses the following term defined in Rec. ITU-T X.683 | ISO/IEC 8824-4:
– parameterized type.
3.4 Additional definitions
3.4.1 component relation constraint: A constraint on the values of a set type or sequence type which is textually
associated with one of the component types (the referencing component) of the set type or sequence type, and which
specifies the relationship between the value of that component and the values of one or more other components
(the referenced components).
3.4.2 constrained type: The innermost "Type" which contains the referencing component and all of the referenced
components of some component relation constraint.
3.4.3 constraining set: The information object set referenced in some component relation constraint.
 Rec. ITU-T X.682 (02/2021) 1
© ISO/IEC 2021 – All rights reserved

---------------------- Page: 7 ----------------------
ISO/IEC 8824-3:2021 (E)
3.4.4 constraining table: The associated table (see Rec. ITU-T X.681 | ISO/IEC 8824-2, clause 13) corresponding
to a constraining set.
3.4.5 referenced component: A component of a set type or sequence type identified in a component relation
constraint.
3.4.6 referencing component: A component of a set type or sequence type which has an associated component
relation constraint.
3.4.7 selected rows: Those rows of a constraining table which contain, in the appropriate columns, the values of all
of the referenced components.
3.4.8 table constraint: A constraint applied to an object class field type which demands that its values conform to
the contents of the appropriate column of some table.
3.4.9 user-defined constraint: A constraint which requires a more complicated statement than can be accommodated
by the other forms of constraint, and which must therefore involve specification by some means outside of ASN.1.
4 Abbreviations
For the purposes of this Recommendation | International Standard, the following abbreviation applies:
ASN.1 Abstract Syntax Notation One
5 Convention
This Recommendation | International Standard employs the notational convention defined in Rec. ITU-T X.680 |
ISO/IEC 8824-1, clause 5.
6 Notation
This clause summarizes the notation defined in this Recommendation | International Standard.
6.1 Constraint
The following notation which can be used as an alternative for "ConstraintSpec" (see Rec. ITU-T X.680 | ISO/IEC 8824-1,
49.6) is defined in this Recommendation | International Standard:
– GeneralConstraint (see 8.1).
7 ASN.1 lexical items
In addition to the lexical items specified in Rec. ITU-T X.680 | ISO/IEC 8824-1, clause 12, this Recommendation |
International Standard makes use of the lexical items specified in the following subclauses. The general rules applicable
to these lexical items are as defined in Rec. ITU-T X.680 | ISO/IEC 8824-1, 12.1. These new lexical items make use of
the ASN.1 character set, as specified in Rec. ITU-T X.680 | ISO/IEC 8824-1, clause 11.
7.1 Additional keywords
The names CONSTRAINED, CONTAINING, ENCODED and BY are listed in Rec. ITU-T X.680 | ISO/IEC 8824-1, 12.38, as
reserved words.
8 General constraint specification
8.1 The notation for a "GeneralConstraint" is as follows:
GeneralConstraint ::=
UserDefinedConstraint
| TableConstraint
| ContentsConstraint
2 Rec. ITU-T X.682 (02/2021)
© ISO/IEC 2021 – All rights reserved

---------------------- Page: 8 ----------------------
ISO/IEC 8824-3:2021 (E)
8.2 The various possibilities for specification of the constraint are defined as follows:
a) "UserDefinedConstraint", in clause 9;
b) "TableConstraint", in clause 10;
c) "ContentsConstraint", in clause 11.
9 User-defined constraints
NOTE 1 – This form of constraint specification can be regarded as a special form of ASN.1 comment, since it is not fully machine-
processable. However, it would be possible for an automatic tool to use the presence of a particular user-defined constraint to
invoke user-supplied constraint checking.
NOTE 2 – Protocol designers should be aware that since the definition of a constraint in this way is not fully machine-processable,
a specification which employs this capability may be less easy to handle with automatic tools.
9.1 A user-defined constraint is specified by the syntax:
UserDefinedConstraint ::=
CONSTRAINED BY "{" UserDefinedConstraintParameter "," * "}"
9.2 It is recommended that the actual constraint be referenced by a comment anywhere inside the braces
( "{" and "}" ). This comment should clearly state what constraint is imposed by the "UserDefinedConstraint".
NOTE – If there are any "UserDefinedConstraintParameter"s within the braces (see 9.3), the comments may precede, follow, or be
interspersed among them, at the definer's convenience.
9.3 The actual constraint to be applied may depend on some parameters. For each such parameter, a
"UserDefinedConstraintParameter" shall be included in the "UserDefinedConstraint". Each
"UserDefinedConstraintParameter" shall be any "Value", "Object", "DefinedObjectSet", "Type" or "DefinedObjectClass"
which is specified by a reference name or, in the case of "Value", "Object" or "Type", can also be defined inline.
NOTE – The reference name may be a dummy parameter if the "UserDefinedConstraint" is used within a
"ParameterizedAssignment".
UserDefinedConstraintParameter ::=
Governor ":" Value
| Governor ":" Object
| DefinedObjectSet
| Type
| DefinedObjectClass
The notation "Governor" is defined in Rec. ITU-T X.683 | ISO/IEC 8824-4, 8.3. When the first alternative is used, the
"Governor" shall be a "Type". When the second alternative is used, the "Governor" shall be a "DefinedObjectClass".
9.4 Example
If an application designer wishes to specify that certain components are to be bit strings carrying an encryption of the
value of some ASN.1 type (different for each component), then (using the parameterization of Rec. ITU-T X.683 |
ISO/IEC 8824-4) the parameterized ENCRYPTED type can be defined as follows:
ENCRYPTED {ToBeEnciphered} ::= BIT STRING
(CONSTRAINED BY
  {-- must be the result of the encipherment of some BER-encoded
  -- value of -- ToBeEnciphered}
! Error : securityViolation)
Error ::= ENUMERATED {securityViolation}
and a use of the ENCRYPTED parameterized subtype of BIT STRING (which is what the ENCRYP
...

Questions, Comments and Discussion

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