Information technology — ASN.1 encoding rules: Specification of Packed Encoding Rules (PER) — Part 2:

ISO/IEC 8825-2:2002 describes a set of encoding rules that can be applied to values of all ASN.1 types to achieve a much more compact representation than that achieved by the Basic Encoding Rules and its derivatives (described in ITU-T Rec.X.690 | ISO/IEC 8826-1).

Technologies de l'information — Règles de codage ASN.1: Spécification des règles de codage compact (PER) — Partie 2:

L'ISO/CEI 8825-2:2002 décrit un ensemble de règles de codage applicables aux valeurs de tous les types ASN.1. Ces règles donnent une représentation plus compacte que celle que l'on peut obtenir au moyen des règles de codage de base et de leurs dérivées (décrites dans la Rec. UIT-T X.690 | ISO/CEI 8825-1).

General Information

Status
Withdrawn
Publication Date
14-Dec-2002
Withdrawal Date
14-Dec-2002
Current Stage
9599 - Withdrawal of International Standard
Completion Date
15-Dec-2009
Ref Project

Relations

Buy Standard

Standard
ISO/IEC 8825-2:2002 - Information technology -- ASN.1 encoding rules: Specification of Packed Encoding Rules (PER)
English language
46 pages
sale 15% off
Preview
sale 15% off
Preview
Standard
ISO/IEC 8825-2:2002 - Technologies de l'information -- Regles de codage ASN.1: Spécification des regles de codage compact (PER)
French language
50 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)

INTERNATIONAL ISO/IEC
STANDARD 8825-2
Third edition
2002-12-15


Information technology — ASN.1
encoding rules: Specification of Packed
Encoding Rules (PER)
Technologies de l'information — Règles de codage ASN.1:
Spécification des règles de codage compact (PER)





Reference number
ISO/IEC 8825-2:2002(E)
©
ISO/IEC 2002

---------------------- Page: 1 ----------------------
ISO/IEC 8825-2:2002(E)
PDF disclaimer
This PDF file may contain embedded typefaces. In accordance with Adobe's licensing policy, this file may be printed or viewed but
shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In
downloading this file, parties accept therein the responsibility of not infringing Adobe's licensing policy. The ISO Central Secretariat
accepts no liability in this area.
Adobe is a trademark of Adobe Systems Incorporated.
Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation
parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In
the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address given below.


©  ISO/IEC 2002
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means,
electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or
ISO's member body in the country of the requester.
ISO copyright office
Case postale 56 • CH-1211 Geneva 20
Tel. + 41 22 749 01 11
Fax + 41 22 749 09 47
E-mail copyright@iso.org
Web www.iso.org
Published by ISO in 2003
Published in Switzerland

ii © ISO/IEC 2002 – All rights reserved

---------------------- Page: 2 ----------------------
ISO/IEC 8825-2:2002(E)

CONTENTS

Page
Introduction . vi
1 Scope . 1
2 Normative references . 1
2.1 Identical Recommendations | International Standards . 1
2.2 Paired Recommendations | International Standards equivalent in technical content. 1
2.3 Additional references . 1
3 Definitions. 2
3.1 Specification of Basic Notation. 2
3.2 Information Object Specification . 2
3.3 Constraint Specification . 2
3.4 Parameterization of ASN.1 Specification . 2
3.5 Basic Encoding Rules . 2
3.6 Additional definitions. 2
4 Abbreviations . 5
5 Notation. 5
6 Convention . 5
7 Encoding rules defined in this Recommendation | International Standard. 5
8 Conformance . 6
9 The approach to encoding used for PER . 6
9.1 Use of the type notation . 6
9.2 Use of tags to provide a canonical order . 7
9.3 PER-visible constraints . 7
9.4 Type and value model used for encoding. 8
9.5 Structure of an encoding . 8
9.6 Types to be encoded. 9
10 Encoding procedures . 10
10.1 Production of the complete encoding. 10
10.2 Open type fields . 10
10.3 Encoding as a non-negative-binary-integer. 10
10.4 Encoding as a 2’s-complement-binary-integer. 11
10.5 Encoding of a constrained whole number . 11
10.6 Encoding of a normally small non-negative whole number. 12
10.7 Encoding of a semi-constrained whole number . 13
10.8 Encoding of an unconstrained whole number . 13
10.9 General rules for encoding a length determinant . 13
11 Encoding the boolean type . 16
12 Encoding the integer type. 16
13 Encoding the enumerated type . 17
14 Encoding the real type. 17
15 Encoding the bitstring type. 17
16 Encoding the octetstring type . 18
17 Encoding the null type. 19
18 Encoding the sequence type . 19
19 Encoding the sequence-of type. 20
20 Encoding the set type . 20
21 Encoding the set-of type. 21
22 Encoding the choice type. 21
© ISO/IEC 2002 – All rights reserved iii

---------------------- Page: 3 ----------------------
ISO/IEC 8825-2:2002(E)
23 Encoding the object identifier type. 22
24 Encoding the relative object identifier type. 22

25 Encoding the embedded-pdv type . 22
26 Encoding of a value of the external type . 22
27 Encoding the restricted character string types . 23
28 Encoding the unrestricted character string type. 25
29 Object identifiers for transfer syntaxes. 25
Annex A – Example of encodings . 27
A.1 – Record that does not use subtype constraints. 27
A.1.1 ASN.1 description of the record structure . 27
A.1.2 ASN.1 description of a record value . 27
A.1.3 ALIGNED PER representation of this record value. 27
A.1.4 UNALIGNED PER representation of this record value. 28
A.2 – Record that uses subtype constraints . 30
A.2.1 ASN.1 description of the record structure . 30
A.2.2 ASN.1 description of a record value . 30
A.2.3 ALIGNED PER representation of this record value. 30
A.2.4 UNALIGNED PER representation of this record value. 31
A.3 – Record that uses extension markers. 32
A.3.1 ASN.1 description of the record structure . 32
A.3.2 ASN.1 description of a record value . 33
A.3.3 ALIGNED PER representation of this record value. 33
A.3.4 UNALIGNED PER representation of this record value. 34
A.4 – Record that uses extension addition groups. 36
A.4.1 ASN.1 description of the record structure . 36
A.4.2 ASN.1 description of a record value . 36
A.4.3 ALIGNED PER representation of this record value. 36
A.4.4 UNALIGNED PER representation of this record value. 37
Annex B – Observations on combining PER-visible constraints. 38
Annex C – Support for the PER algorithms. 43
Annex D – Support for the ASN.1 rules of extensibility . 44
Annex E – Tutorial annex on concatenation of PER encodings . 45
Annex F – Assignment of object identifier values. 46

iv © ISO/IEC 2002 – All rights reserved

---------------------- Page: 4 ----------------------
ISO/IEC 8825-2:2002(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. In the field of information
technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1.
International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2.
The main task of the joint technical committee is to prepare International Standards. Draft International
Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as
an International Standard requires approval by at least 75 % of the national bodies casting a vote.
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.
ISO/IEC 8825-2 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 Rec. X.691.
This third edition cancels and replaces the second edition (ISO/IEC 8825-2:1998), which has been technically
revised. It also incorporates the Amendment ISO/IEC 8825-2:1998/Amd.1:2000 and the Technical Corrigenda
ISO/IEC 8825-2:1998/Cor.1:1999, ISO/IEC 8825-2:1998/Cor.2:2002 and ISO/IEC 8825-2:1998/Cor.3:2002.
ISO/IEC 8825 consists of the following parts, under the general title Information technology — ASN.1
encoding rules:
— Part 1: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER)
— Part 2: Specification of Packed Encoding Rules (PER)
— Part 3: Specification of Encoding Control Notation (ECN)
— Part 4: XML Encoding Rules (XER)
— Part 5: Mapping W3C XML schema definitions into ASN.1
© ISO/IEC 2002 – All rights reserved v

---------------------- Page: 5 ----------------------
ISO/IEC 8825-2:2002(E)
Introduction


The publications ITU-T Rec. X.680 | ISO/IEC 8824-1, ITU-T Rec. X.681 | ISO/IEC 8824-2, ITU-T Rec. X.682 |

ISO/IEC 8824-3, ITU-T Rec. X.683 | ISO/IEC 8824-4 together describe Abstract Syntax Notation One (ASN.1), a
notation for the definition of messages to be exchanged between peer applications.
This Recommendation | International Standard defines encoding rules that may be applied to values of types defined
using the notation specified in ITU-T Rec. X.680 | ISO/IEC 8824-1. Application of these encoding rules produces a
transfer syntax for such values. It is implicit in the specification of these encoding rules that they are also to be used for
decoding.
There are more than one set of encoding rules that can be applied to values of ASN.1 types. This Recommendation |
International Standard defines a set of Packed Encoding Rules (PER), so called because they achieve a much more
compact representation than that achieved by the Basic Encoding Rules (BER) and its derivatives described in ITU-T
Rec. X.690 | ISO/IEC 8825-1 which is referenced for some parts of the specification of these Packed Encoding Rules.

vi © ISO/IEC 2002 – All rights reserved

---------------------- Page: 6 ----------------------
ISO/IEC 8824-1:2002 (E)ISO/IEC 8825-1:2002 (E)ISO/ISO/IEC 8825-2:2002 (E)IEC 8825-2:2003 (E)
INTERNATIONAL STANDARD
ISO/IEC 8825-2 : 1995 (E)
ITU-T Rec. X.691 (1995 E)
ITU-T RECOMMENDATION
Information technology –
ASN.1 encoding rules:
Specification of Packed Encoding Rules (PER)
1 Scope
This Recommendation | International Standard specifies a set of Packed Encoding Rules that may be used to derive a
transfer syntax for values of types defined in ITU-T Rec. X.680 | ISO/IEC 8824-1. These Packed Encoding Rules are
also to be applied for decoding such a transfer syntax in order to identify the data values being transferred.
The encoding rules specified in this Recommendation | International Standard:
– are used at the time of communication;
– are intended for use in circumstances where minimizing the size of the representation of values is the
major concern in the choice of encoding rules;
– allow the extension of an abstract syntax by addition of extra values, preserving the encodings
of the existing values, for all forms of extension described in ITU-T Rec. X.680 | ISO/IEC 8824-1.
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
– ITU-T Recommendation X.680 (2002) | ISO/IEC 8824-1:2002, Information technology – Abstract Syntax
Notation One (ASN.1): Specification of basic notation.
– ITU-T Recommendation X.681 (2002) | ISO/IEC 8824-2:2002, Information technology – Abstract Syntax
Notation One (ASN.1): Information object specification.
– ITU-T Recommendation X.682 (2002) | ISO/IEC 8824-3:2002, Information technology – Abstract Syntax
Notation One (ASN.1): Constraint specification.
– ITU-T Recommendation X.683 (2002) | ISO/IEC 8824-4:2002, Information technology – Abstract Syntax
Notation One (ASN.1): Parameterization of ASN.1 specifications.
– ITU-T Recommendation X.690 (2002) | ISO/IEC 8825-1:2002, Information technology – ASN.1 encoding
rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished
Encoding Rules (DER).
2.2 Paired Recommendations | International Standards equivalent in technical content
2.3 Additional references
– ISO/IEC 646:1991, Information technology – ISO 7-bit coded character set for information interchange.
– ISO/IEC 2022:1994, Information technology – Character code structure and extension techniques.
– ISO 2375:1985, Data processing – Procedure for registration of escape sequences.
– ISO 6093:1985, Information processing – Representation of numerical values in character strings for
information interchange.
  ITU-T Rec. X.691 (07/2002) 1

---------------------- Page: 7 ----------------------
ISO/ISO/IEC 8824-1:2002 (E)ISO/IEC 8825-1:2002 (E)ISO/IEC 8825-2:2002 (E)IEC 8825-2:2003 (E)
– ISO International Register of Coded Character Sets to be Used with Escape Sequences.
– ISO/IEC 10646-1:2000, Information technology – Universal Multiple-Octet Coded Character
Set (UCS) – Part 1: Architecture and Basic Multilingual Plane.
3 Definitions
For the purposes of this Recommendation | International Standard, the following definitions apply.
3.1 Specification of Basic Notation
For the purposes of this Recommendation | International Standard, all the definitions in ITU-T Rec. X.680 |
ISO/IEC 8824-1 apply.
3.2 Information Object Specification
For the purposes of this Recommendation | International Standard, all the definitions in ITU-T Rec. X.681 |
ISO/IEC 8824-2 apply.
3.3 Constraint Specification
This Recommendation | International Standard makes use of the following terms defined in ITU-T Rec. X.682 |
ISO/IEC 8824-3:
a) component relation constraint;
b) table constraint.
3.4 Parameterization of ASN.1 Specification
This Recommendation | International Standard makes use of the following term defined in ITU-T Rec. X.683 |
ISO/IEC 8824-4:
– variable constraint.
3.5 Basic Encoding Rules
This Recommendation | International Standard makes use of the following terms defined in ITU-T Rec. X.690 |
ISO/IEC 8825-1:
a) dynamic conformance;
b) static conformance;
c) data value;
d) encoding (of a data value);
e) sender;
f) receiver.
3.6 Additional definitions
For the purposes of this Recommendation | International Standard, the following definitions apply.
3.6.1 2's-complement-binary-integer encoding: The encoding of a whole number into a bit-field (octet-aligned in
the ALIGNED variant) of a specified length, or into the minimum number of octets that will accommodate that whole
number encoded as a 2's-complement-integer, which provides representations for whole numbers that are equal to,
greater than, or less than zero, as specified in 10.4.
NOTE 1 – The value of a two's complement binary number is derived by numbering the bits in the contents octets, starting with
bit 1 of the last octet as bit zero and ending the numbering with bit 8 of the first octet. Each bit is assigned a numerical value of
N
, where N is its position in the above numbering sequence. The value of the two's complement binary number is obtained by
2
summing the numerical values assigned to each bit for those bits which are set to one, excluding bit 8 of the first octet, and then
reducing this value by the numerical value assigned to bit 8 of the first octet if that bit is set to one.
NOTE 2 – Whole number is a synonym for the mathematical term integer. It is used here to avoid confusion with the ASN.1 type
integer.
2 ITU-T Rec. X.691 (07/2002)

---------------------- Page: 8 ----------------------
ISO/IEC 8824-1:2002 (E)ISO/IEC 8825-1:2002 (E)ISO/ISO/IEC 8825-2:2002 (E)IEC 8825-2:2003 (E)
3.6.2 abstract syntax value: A value of an abstract syntax (defined as the set of values of a single ASN.1 type),
which is to be encoded by PER, or which is to be generated by PER decoding.
NOTE – The single ASN.1 type associated with an abstract syntax is formally identified by an object of class ABSTRACT-SYNTAX.
3.6.3 bit-field: The product of some part of the encoding mechanism that consists of an ordered set of bits that are
not necessarily a multiple of eight.
NOTE – If the use of this term is followed by "octet-aligned in the ALIGNED variant", this means that the bit-field is required to
begin on an octet boundary in the complete encoding for the aligned variant of PER.
3.6.4 canonical encoding: A complete encoding of an abstract syntax value obtained by the application of encoding
rules that have no implementation-dependent options; such rules result in the definition of a 1-1 mapping between
unambiguous and unique bitstrings in the transfer syntax and values in the abstract syntax.
3.6.5 composite type: A set, sequence, set-of, sequence-of, choice, embedded-pdv, external or unrestricted character
string type.
3.6.6 composite value: The value of a composite type.
3.6.7 constrained whole number: A whole number which is constrained by PER-visible constraints to lie within a
range from "lb" to "ub" with the value "lb" less than or equal to "ub", and the values of "lb" and "ub" as permitted
values.
NOTE – Constrained whole numbers occur in the encoding which identifies the chosen alternative of a choice type, the length of
character, octet and bit string types whose length has been restricted by PER-visible constraints to a maximum length, the count of
the number of components in a sequence-of or set-of type that has been restricted by PER-visible constraints to a maximum
number of components, the value of an integer type that has been constrained by PER-visible constraints to lie within finite
minimum and maximum values, and the value that denotes an enumeration in an enumerated type.
3.6.8 effective size constraint (for a constrained string type): A single finite size constraint that could be applied
to a built-in string type and whose effect would be to permit all and only those lengths that can be present in the
constrained string type.
NOTE 1 – For example, the following has an effective size constraint:
A ::= IA5String (SIZE(1.4) | SIZE(10.15))
since it can be rewritten with a single size constraint that applies to all values:
A ::= IA5String (SIZE(1.4 | 10.15))
whereas the following has no effective size constraint since the string can be arbitrarily long if it does not contain any characters
other than 'a', 'b' and 'c':
B ::= IA5String (SIZE(1.4) | FROM("abc"))
NOTE 2 – The effective size constraint is used only to determine the encoding of lengths.
3.6.9 effective permitted-alphabet constraint (for a constrained restricted character string type): A single
permitted-alphabet constraint that could be applied to a built-in known-multiplier character string type and whose effect
would be to permit all and only those characters that can be present in at least one character position of any one of the
values in the constrained restricted character string type.
NOTE 1 – For example, in:
Ax ::= IA5String (FROM("AB") | FROM("CD"))
Bx ::= IA5String (SIZE(1.4) | FROM("abc"))
Ax has an effective permitted-alphabet constraint of "ABCD". Bx has an effective permitted-alphabet constraint that consists
of the entire IA5String alphabet since there is no smaller permitted-alphabet constraint that applies to all values of Bx.
NOTE 2 – The effective permitted-alphabet constraint is used only to determine the encoding of characters.
3.6.10 enumeration index: The non-negative whole number associated with an "EnumerationItem" in an enumerated
type. The enumeration indices are determined by sorting the "EnumerationItem"s into ascending order by their
enumeration value, then by assigning an enumeration index starting with zero for the first "EnumerationItem", one for
the second, and so on up to the last "EnumerationItem" in the sorted list.
NOTE – "EnumerationItem"s in the "RootEnumeration" are sorted separately from those in the "AdditionalEnumeration".
3.6.11 extensible for PER encoding: A property of a type which requires that PER identifies an encoding of a value
as that of a root value or as that of an extension addition.
NOTE – Root values are normally encoded more efficiently than extension additions.
3.6.12 field-list: An ordered set of bit-fields that is produced as a result of applying these encoding rules to
components of an abstract value.
3.6.13 indefinite-length: An encoding whose length is greater than 64K-1 or whose maximum length cannot be
determined from the ASN.1 notation.
  ITU-T Rec. X.691 (07/2002) 3

---------------------- Page: 9 ----------------------
ISO/ISO/IEC 8824-1:2002 (E)ISO/IEC 8825-1:2002 (E)ISO/IEC 8825-2:2002 (E)IEC 8825-2:2003 (E)
3.6.14 fixed-length type: A type such that the value of the outermost length determinant in an encoding of this type
can be determined (using the mechanisms specified in this Recommendation | International Standard) from the type
notation (after the application of PER-visible constraints only) and is the same for all possible values of the type.
3.6.15 fixed value: A value such that it can be determined (using the mechanisms specified in this Recommendation |
International Standard) that this is the only permitted value (after the application of PER-visible constraints only) of the
type governing it.
3.6.16 known-multiplier character string type: A restricted character string type where the number of octets in the
encoding is a known fixed multiple of the number of characters in the character string for all permitted character string
values. The known-multiplier character string types are IA5String, PrintableString, VisibleString,
Nu
...

NORME ISO/CEI
INTERNATIONALE 8825-2
Troisième édition
2002-12-15


Technologies de l'information — Règles
de codage ASN.1: Spécification des
règles de codage compact (PER)
Information technology — ASN.1 encoding rules: Specification of
Packed Encoding Rules (PER)




Numéro de référence
ISO/CEI 8825-2:2002(F)
©
ISO/CEI 2002

---------------------- Page: 1 ----------------------
ISO/CEI 8825-2:2002(F)
PDF – Exonération de responsabilité
Le présent fichier PDF peut contenir des polices de caractères intégrées. Conformément aux conditions de licence d'Adobe, ce fichier
peut être imprimé ou visualisé, mais ne doit pas être modifié à moins que l'ordinateur employé à cet effet ne bénéficie d'une licence
autorisant l'utilisation de ces polices et que celles-ci y soient installées. Lors du téléchargement de ce fichier, les parties concernées
acceptent de fait la responsabilité de ne pas enfreindre les conditions de licence d'Adobe. Le Secrétariat central de l'ISO décline toute
responsabilité en la matière.
Adobe est une marque déposée d'Adobe Systems Incorporated.
Les détails relatifs aux produits logiciels utilisés pour la création du présent fichier PDF sont disponibles dans la rubrique General Info
du fichier; les paramètres de création PDF ont été optimisés pour l'impression. Toutes les mesures ont été prises pour garantir
l'exploitation de ce fichier par les comités membres de l'ISO. Dans le cas peu probable où surviendrait un problème d'utilisation,
veuillez en informer le Secrétariat central à l'adresse donnée ci-dessous.


©  ISO/CEI 2002
Droits de reproduction réservés. Sauf prescription différente, aucune partie de cette publication ne peut être reproduite ni utilisée sous
quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie et les microfilms, sans l'accord écrit
de l'ISO à l'adresse ci-après ou du comité membre de l'ISO dans le pays du demandeur.
ISO copyright office
Case postale 56 • CH-1211 Geneva 20
Tel. + 41 22 749 01 11
Fax. + 41 22 749 09 47
E-mail copyright@iso.org
Web www.iso.org
Version française parue en 2006
Publié en Suisse

ii © ISO/CEI 2002 – Tous droits réservés

---------------------- Page: 2 ----------------------
ISO/CEI 8825-2:2002(F)
TABLE DES MATIÈRES
Page
1 Domaine d'application . 1
2 Références normatives. 1
2.1 Recommandations | Normes internationales identiques. 1
2.2 Paires de Recommandations | Normes internationales équivalentes par leur contenu technique. 1
2.3 Autres références . 1
3 Définitions . 2
3.1 Spécification de la notation de base . 2
3.2 Spécification des objets informationnels . 2
3.3 Spécification des contraintes . 2
3.4 Spécification du paramétrage en notation ASN.1. 2
3.5 Règles de codage de base. 2
3.6 Autres définitions. 2
4 Abréviations. 5
5 Notation . 5
6 Conventions . 5
7 Règles de codage définies dans la présente Recommandation | Norme internationale . 5
8 Conformité. 6
9 Méthode de codage utilisée pour les règles PER . 7
9.1 Utilisation de la notation de types. 7
9.2 Utilisation d'étiquettes pour établir un ordre canonique. 7
9.3 Contraintes visibles par les règles PER. 7
9.4 Modèle utilisé pour coder les types et les valeurs. 9
9.5 Structure d'une expression codée. 9
9.6 Types à coder. 10
10 Procédures de codage . 10
10.1 Production du codage complet . 10
10.2 Champs de type ouvert. 11
10.3 Codage sous forme d'un entier binaire non négatif . 11
10.4 Codage sous forme d'un entier binaire en complément à deux . 12
10.5 Codage d'un nombre entier contraint. 12
10.6 Codage d'un nombre entier non négatif normalement petit. 13
10.7 Codage d'un nombre entier semi-contraint. 13
10.8 Codage d'un nombre entier non contraint . 14
10.9 Règles générales pour le codage d'un déterminant de longueur. 14
11 Codage du type booléen. 17
12 Codage du type entier. 17
13 Codage du type énuméré. 18
14 Codage du type réel . 18
15 Codage du type chaîne binaire. 18
16 Codage du type chaîne d'octets. 19
17 Codage du type néant . 20
18 Codage du type séquence . 20
19 Codage du type séquence-de. 21
20 Codage du type ensemble. 22
21 Codage du type ensemble-de. 22
22 Codage du type choix. 22
23 Codage du type identificateur d'objet. 23
24 Codage du type identificateur d'objet relatif . 23

© ISO/CEI 2002 – Tous droits réservés iii

---------------------- Page: 3 ----------------------
ISO/CEI 8825-2:2002(F)
Page
25 Codage d'une valeur type valeur de donnée de présentation enchâssée . 24
26 Codage d'une valeur du type externe. 24
27 Codage des types chaîne de caractères restreinte. 25
28 Codage du type chaîne de caractères non restreinte . 27
29 Identificateurs d'objet pour syntaxes de transfert. 27
Annexe A – Exemples de codages. 29
A.1 Enregistrement qui n'utilise pas de contrainte appliquée aux sous-types . 29
A.2 Enregistrement utilisant des contraintes appliquées aux sous-types . 32
A.3 Enregistrement qui utilise des marqueurs d'extension . 35
A.4 Enregistrement utilisant des groupes d'adjonctions d'extension. 38
Annexe B – Combinaison de contraintes visibles par les règles PER et de contraintes non visibles par les
règles PER. 41
B.1 Généralités. 41
B.2 Extensibilité et visibilité des contraintes liées aux règles PER . 42
B.3 Exemples. 45
Annexe C – Prise en charge des algorithmes PER. 47
Annexe D – Prise en charge des règles d'extensibilité ASN.1. 48
Annexe E – Complément didactique sur la concaténation de codages conformes aux règles PER. 49
Annexe F – Affectation de valeurs à un identificateur d'objet. 50






iv © ISO/CEI 2002 – Tous droits réservés

---------------------- Page: 4 ----------------------
ISO/CEI 8825-2:2002(F)
Avant-propos
L'ISO (Organisation internationale de normalisation) et la CEI (Commission électrotechnique internationale) forment le
système spécialisé de la normalisation mondiale. Les organismes nationaux membres de l'ISO ou de la CEI participent au
développement de Normes internationales par l'intermédiaire des comités techniques créés par l'organisation concernée
afin de s'occuper des domaines particuliers de l'activité technique. Les comités techniques de l'ISO et de la CEI
collaborent dans des domaines d'intérêt commun. D'autres organisations internationales, gouvernementales et non
gouvernementales, en liaison avec l'ISO et la CEI participent également aux travaux. Dans le domaine des technologies
de l'information, l'ISO et la CEI ont créé un comité technique mixte, l'ISO/CEI JTC 1.
Les Normes internationales sont rédigées conformément aux règles données dans les Directives ISO/CEI, Partie 2.
La tâche principale du comité technique mixte est d'élaborer les Normes internationales. Les projets de Normes
internationales adoptés par le comité technique mixte sont soumis aux organismes nationaux pour vote. Leur publication
comme Normes internationales requiert l'approbation de 75 % au moins des organismes nationaux votants.
L'attention est appelée sur le fait que certains des éléments du présent document peuvent faire l'objet de droits de
propriété intellectuelle ou de droits analogues. L'ISO et la CEI ne sauraient être tenues pour responsables de ne pas avoir
identifié de tels droits de propriété et averti de leur existence.
L'ISO/CEI 8825-2 a été élaborée par le comité technique mixte ISO/CEI JTC 1, Technologies de l’information,
sous-comité SC 6, Téléinformatique, en collaboration avec l’UIT-T. Le texte identique est publié en tant que Rec. UIT-T
X.691.
Cette troisième édition annule et remplace la deuxième édition (ISO/CEI 8825-2:1998), qui a fait l'objet d'une révision
technique. Elle incorpore aussi l’Amendement ISO/CEI 8825-2:1998/Amd.1:2000 ainsi que les Rectificatifs techniques
ISO/CEI 8825-2:1998/Cor.1:1999, ISO/CEI 8825-2:1998/Cor.2:2002 et ISO/CEI 8825-2:1998/Cor.3:2002.
L'ISO/CEI 8825 comprend les parties suivantes, présentées sous le titre général Technologies de l'information — Règles
de codage ASN.1:
⎯ Partie 1: Spécification des règles de codage de base (BER), des règles de codage canoniques (CER) et des règles de
codage distinctives (DER)
⎯ Partie 2: Spécification des règles de codage compact (PER)
⎯ Partie 3: Spécification de la notation de contrôle de codage (ECN)
⎯ Partie 4: Règles de codage XML (XER)
⎯ Partie 5: Mappage en ASN.1 des définitions de schéma XML du W3C

© ISO/CEI 2002 – Tous droits réservés v

---------------------- Page: 5 ----------------------
ISO/CEI 8825-2:2002(F)

Introduction
L'ensemble de documents Rec. UIT-T X.680 | ISO/CEI 8824-1, Rec. UIT-T X.681 | ISO/CEI 8824-2,
Rec. UIT-T X.682 | ISO/CEI 8824-3, Rec. UIT-T X.683 | ISO/CEI 8824-4 décrivent la notation de syntaxe abstraite
numéro un (ASN.1) qui permet de définir les messages échangés par des applications homologues.
La présente Recommandation | Norme internationale définit les règles de codage qui pourront être appliquées à des
valeurs de types définis conformément à la notation spécifiée dans la Rec. UIT-T X.680 | ISO/CEI 8824-1.
L'application de ces règles de codage produit une syntaxe de transfert pour de telles valeurs. La spécification de ces
règles de codage postule implicitement que ces règles pourront être utilisées telles quelles pour le décodage.
Plusieurs ensembles de règles de codage peuvent être appliqués à des valeurs de types ASN.1. La présente
Recommandation | Norme internationale définit un ensemble de règles de codage compact (PER, packed encoding
rules), ainsi dénommées parce qu'elles donnent une représentation plus compacte que celle que l'on peut obtenir au
moyen des règles de codage de base (BER, basic encoding rules) et de leurs dérivées, décrites dans la
Rec. UIT-T X.690 | ISO/CEI 8825-1, à laquelle font référence certaines parties de la spécification des présentes règles
de codage compact.

vi © ISO/CEI 2002 – Tous droits réservés

---------------------- Page: 6 ----------------------
ISO/CEI 8825-2:2002 (F)
NORME INTERNATIONALE
RECOMMANDATION UIT-T
Technologies de l'information – Règles de codage ASN.1:
spécification des règles de codage compact
1 Domaine d'application
La présente Recommandation | Norme internationale spécifie un ensemble de règles de codage compact qui peuvent
être utilisées pour élaborer une syntaxe de transfert applicable à des valeurs de types définis dans la Rec. UIT-T X.680 |
ISO/CEI 8824-1. Ces règles de codage compact sont également applicables au décodage d'une telle syntaxe de transfert
afin d'identifier les valeurs de données qui sont transférées.
Les règles de codage spécifiées dans la présente Recommandation | Norme internationale:
– sont utilisées au moment de la communication;
– sont destinées à être utilisées dans des circonstances où la minimisation du volume occupé par la
représentation de valeurs est la principale préoccupation lors du choix de règles de codage;
– permettent l'extension d'une syntaxe abstraite par adjonction de valeurs supplémentaires, tout en
conservant les codages des valeurs existantes, pour toutes les formes d'extension décrites dans la
Rec. UIT-T X.680 | ISO/CEI 8824-1.
2 Références normatives
Les Recommandations et Normes internationales suivantes contiennent des dispositions qui, par suite de la référence
qui y est faite, constituent des dispositions valables pour la présente Recommandation | Norme internationale. Au
moment de la publication, les éditions indiquées étaient en vigueur. Toutes Recommandations et Normes sont sujettes à
révision et les parties prenantes aux accords fondés sur la présente Recommandation | Norme internationale sont
invitées à rechercher la possibilité d'appliquer les éditions les plus récentes des Recommandations et Normes indiquées
ci-après. Les membres de la CEI et de l'ISO possèdent le registre des Normes internationales en vigueur. Le Bureau de
la normalisation des télécommunications de l'UIT tient à jour une liste des Recommandations de l'UIT-T en vigueur.
2.1 Recommandations | Normes internationales identiques
– Recommandation UIT-T X.680 (2002) | ISO/CEI 8824-1:2002, Technologies de l'information – Notation
de syntaxe abstraite numéro un: spécification de la notation de base.
– Recommandation UIT-T X.681 (2002) | ISO/CEI 8824-2:2002, Technologies de l'information – Notation
de syntaxe abstraite numéro un: spécification des objets informationnels.
– Recommandation UIT-T X.682 (2002) | ISO/CEI 8824-3:2002, Technologies de l'information – Notation
de syntaxe abstraite numéro un: spécification des contraintes.
– Recommandation UIT-T X.683 (2002) | ISO/CEI 8824-4:2002, Technologies de l'information – Notation
de syntaxe abstraite numéro un: paramétrage des spécifications de la notation de syntaxe abstraite
numéro un.
– Recommandation UIT-T X.690 (2002) | ISO/CEI 8825-1:2002, Technologies de l'information – Règles
de codage ASN.1: spécification des règles de codage de base, des règles de codage canoniques et des
règles de codage distinctives.
2.2 Paires de Recommandations | Normes internationales équivalentes par leur contenu technique
2.3 Autres références
– ISO/CEI 646:1991, Technologies de l'information – Jeu ISO de caractères codés à 7 éléments pour
l'échange d'information.
– ISO/CEI 2022:1994, Technologies de l'information – Structure de code de caractères et techniques
d'extension.
– ISO 2375:2003, Traitement de l'information – Procédure pour l'enregistrement des séquences
d'échappement et des jeux de caractères codés.
 Rec. UIT-T X.691 (07/2002) 1

---------------------- Page: 7 ----------------------
ISO/CEI 8825-2:2002 (F)
– ISO 6093:1985, Traitement de l'information – Représentation des valeurs numériques dans les chaînes
de caractères pour l'échange d'information.
– ISO Registre international des jeux de caractères codés à utiliser avec une séquence d'échappement.
– ISO/CEI 10646-1:2003, Technologies de l'information – Jeu universel de caractères codés sur plusieurs
octets (JUC).
3 Définitions
Pour les besoins de la présente Recommandation | Norme internationale, les définitions suivantes s'appliquent.
3.1 Spécification de la notation de base
Pour les besoins de la présente Recommandation | Norme internationale, toutes les définitions contenues dans la
Rec. UIT-T X.680 | ISO/CEI 8824-1 s'appliquent.
3.2 Spécification des objets informationnels
Pour les besoins de la présente Recommandation | Norme internationale, toutes les définitions figurant dans la
Rec. UIT-T X.681 | ISO/CEI 8824-2 s'appliquent.
3.3 Spécification des contraintes
La présente Recommandation | Norme internationale utilise le terme suivant défini dans la Rec. UIT-T X.682 |
ISO/CEI 8824-3:
a) contrainte relationnelle de composante;
b) contrainte tabulaire.
3.4 Spécification du paramétrage en notation ASN.1
La présente Recommandation | Norme internationale utilise le terme suivant défini dans la Rec. UIT-T X.683 |
ISO/CEI 8824-4:
– contrainte variable.
3.5 Règles de codage de base
La présente Recommandation | Norme internationale utilise les termes suivants définis dans la Rec. UIT-T X.690 |
ISO/CEI 8825-1:
a) conformité dynamique;
b) conformité statique;
c) valeur de données;
d) codage (d'une valeur de données);
e) expéditeur;
f) destinataire.
3.6 Autres définitions
Pour les besoins de la présente Recommandation | Norme internationale, les définitions suivantes s'appliquent.
3.6.1 codage d'entier binaire en complément à 2: codage d'un nombre entier sur un champ binaire (calé à l'octet
suivant la variante ALIGNED) de longueur spécifiée, ou sur le nombre minimal d'octets permettant de représenter cet
entier (égal, supérieur ou inférieur à zéro comme spécifié au § 10.4) sous forme d'un entier en complément à deux.
NOTE 1 – La représentation d'un nombre binaire en complément à deux est obtenue en numérotant les bits des octets qui le
composent, en commençant par le bit 1 du dernier octet qui devient le bit 0 et en terminant par le bit 8 du premier octet. A chaque
N
bit est affectée une valeur numérique de 2 , N étant la position du bit dans la séquence de numérotation précédente. La valeur du
nombre binaire en complément à deux est obtenue en ajoutant les valeurs numériques affectées à chacun des bits qui sont à un,
sauf le bit 8 du premier octet, puis en soustrayant de cette valeur la valeur numérique affectée à ce bit 8 du premier octet, s'il est
à un.
2 Rec. UIT-T X.691 (07/2002)

---------------------- Page: 8 ----------------------
ISO/CEI 8825-2:2002 (F)
NOTE 2 – L'expression nombre entier est synonyme du terme mathématique entier. Elle est utilisée à la place de celui-ci pour
éviter une confusion avec le type entier (integer) de l'ASN.1.
3.6.2 valeur de syntaxe abstraite: valeur d'une syntaxe abstraite (définie comme l'ensemble des valeurs d'un type
unique ASN.1), à coder selon les règles PER, ou à générer par un décodage PER.
NOTE – Le type ASN.1 unique associé à une syntaxe abstraite est identifié de façon formelle par un objet de la classe
ABSTRACT-SYNTAX.
3.6.3 champ binaire: produit d'une partie du processus de codage, qui se compose d'un ensemble ordonné
d'éléments binaires. Cet ensemble n'est pas nécessairement un multiple de 8.
NOTE – Si l'utilisation de ce terme est suivie de la mention "calé à l'octet suivant la variante ALIGNED", cela signifie que ce
champ binaire doit commencer au niveau d'une limite d'octet dans le cadre du codage complet pour la variante ALIGNED des
règles PER.
3.6.4 codage canonique: codage complet d'une valeur dans la syntaxe abstraite, obtenu par application de règles de
codage ne comportant aucune option dépendant de l'implémentation; de telles règles se traduisent – dans la syntaxe de
transfert et dans les valeurs de la syntaxe abstraite – par des mappages biunivoques entre chaînes binaires non ambiguës
et uniques de la syntaxe de transfert et valeurs de la syntaxe abstraite.
3.6.5 type composite: type du genre ensemble, séquence, ensemble-de, séquence-de, choix, valeur pdv incorporée,
externe ou chaîne de caractères.
3.6.6 valeur composite: valeur d'un type composite.
3.6.7 entier contraint: nombre entier soumis par les contraintes visibles des règles PER, de manière à s'inscrire
dans un intervalle compris entre une borne inférieure "lb" et une borne supérieure "ub", bornes comprises, avec "lb"
inférieure ou égale à "ub".
NOTE – Les nombres entiers contraints apparaissent dans les codages qui identifient l'alternative choisie dans un type choix, ou
la longueur d'une chaîne binaire, de caractères ou d'octets lorsque la longueur du type de celle-ci est limitée à un maximum par
une contrainte visible des règles PER, ou le nombre de composantes d'une valeur de type séquence-de ou ensemble-de lorsque le
nombre des composantes d'un tel type est limité à un maximum par une contrainte visible des règles PER, ou la valeur d'un entier
lorsque le type de celui-ci est limité à un intervalle fini par une contrainte visible des règles PER, ou la valeur ordinale d'un
élément appartenant à un type énuméré.
3.6.8 contrainte effective de taille (pour un type chaîne contrainte): contrainte unique limitant une taille à une
valeur finie, qui peut être appliquée à un type chaîne natif et dont l'effet sera de permettre toutes les longueurs – et
seulement celles-ci – qui peuvent être présentes dans le type chaîne contrainte.
NOTE 1 – Par exemple, la définition suivante est soumise à une contrainte effective de taille:
A ::= IA5String (SIZE(1.4) | SIZE(10.15))
car on peut la réécrire sous forme d'une unique contrainte de taille qui s'applique à toutes les valeurs comme suit:
A ::= IA5String (SIZE(1.4 | 10.15))
tandis que l'expression suivante n'est soumise à aucune contrainte effective de taille car la chaîne peut avoir une longueur
quelconque si elle ne contient pas d'autres caractères que 'a', 'b' et 'c':
B ::= IA5String (SIZE(1.4) | FROM("abc"))
NOTE 2 – La contrainte effective de taille sert uniquement à déterminer le codage des longueurs.
3.6.9 contrainte effective d'alphabet permis (pour un type chaîne de caractères restreinte et contrainte):
contrainte unique d'alphabet permis que l'on peut appliquer à un type natif chaîne de caractères à multiplicateur connu,
dont l'effet sera de permettre tous les caractères – et seulement ceux-ci – qui peuvent occuper au moins une position de
caractère dans n'importe quelle valeur contenue dans le type chaîne contrainte.
NOTE 1 – Par exemple dans:
Ax ::= IA5String (FROM("AB") | FROM("CD"))
Bx ::= IA5String (SIZE(1.4) | FROM("abc"))
la chaîne "Ax" obéit à une contrainte effective d'alphabet permis "ABCD", et "Bx" obéit à une contrainte effective d'alphabet
permis qui consiste en l'alphabet IA5String complet, puisque aucune contrainte d'alphabet permis plus petite ne s'applique
à toutes les valeurs de "Bx".
NOTE 2 – La contrainte effective d'alphabet permis sert uniquement à déterminer le codage des caractères.
3.6.10 indice d'énumération: nombre entier non négatif associé à un item dans un type énuméré (enumerated). Les
index d'énumération sont déterminés en classant les items par ordre croissant de la valeur énumérée, puis en affectant un
index d'énumération égal à 0 pour le premier item, à 1 pour le deuxième, etc., jusqu'au dernier élément de la liste ainsi
ordonnée.
NOTE – Les items de base ("RootEnumeration") et les items additionnels ("AdditionalEnumeration") sont triés séparément.
3.6.11 extensibilité pour un codage compact: propriété d'un type qui requiert que les règles PER identifient le
codage d'une valeur comme étant celui d'une valeur racine ou celui d'une addition d'extension.
NOTE – Les valeurs racine sont généralement codées d'une manière plus efficace que les additions d'extension.
 Rec. UIT-T X.691 (07/2002) 3

---------------------- Page: 9 ----------------------
ISO/CEI 8825-2:2002 (F)
3.6.12 liste de champs: ensemble ordonné de champs binaires qui résulte de l'application des présentes règles de
codage aux composantes d'une valeur abstraite.
3.6.13 longueur non définie: codage dont la longueur est supérieure à 64K-1 ou dont la longueur maximale ne peut
pas être déterminée d'après la notation ASN.1.
3.6.14 type de longueur fixe: type tel que l'on puisse déterminer – à partir de la notation de type (après application
des seules contraintes visibles par les règles PER) – la valeur du déterminant de longueur le plus extérieur dans une
séquence codée de ce type (au moyen des mécanismes spécifiés dans la présente Recommandation | Norme
internationale) et tel que cette valeur soit la même pour toutes les valeurs possibles de ce type.
3.6.15 valeur fixe: valeur telle qu'elle puisse être déterminée (au moyen des mécanismes spécifiés dans la présente
Recommandation | Norme internationale) comme étant la seule valeur permise (après application des seules contraintes
visibles par les règles PER) du type dont elle dépend.
3.6.16 type chaîne de caractères à multiplicateur connu: type de chaîne de caractères restreinte dont le nombre
d'octets codés est un multiple fixe et connu du nombre de caractères contenus dans la chaîne de caractères pour toutes
les valeurs permises de la chaîne de caractères. Les types chaîne de caractères à multiplicateur connu sont les suivants:
IA5String, PrintableString, VisibleString, NumericString, UniversalString et BMPString.
3.6.17 déterminant de longueur: compte (de bits, d'octets, de caractères ou de composantes) qui détermine la
longueur de tout ou partie d'une séquence à codage PER.
3.6.18 nombre entier non négatif normalement petit: partie d'une séquence codée qui représente un entier non
négatif et non délimité, mais dont les petites valeurs sont normalement plus fréquentes que les grandes.
3.6.19 longueur normalement petite: codage d'une longueur qui représente les valeurs d'une longueur non
délimitée, mais telle que les petites valeurs de cette longueur soient normalement plus fréquentes que les grandes.
3.6.20 codage d'entier binaire non négatif: codage d'un nombre entier contraint ou semi-contraint pour obtenir soit
un champ binaire de longueur spécifiée, soit un champ binaire (aligné à l'octet suivant la variante ALIGNED) de
longueur spécifiée, soit encore le nombre minimal d'octets permettant de représenter ce nombre entier so
...

Questions, Comments and Discussion

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