ISO/IEC 8825-1:2021
(Main)Information technology — ASN.1 encoding rules — Part 1: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)
Information technology — ASN.1 encoding rules — Part 1: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)
This document specifies a set of basic encoding rules that may be used to derive the specification of a transfer syntax for values of types defined using the notation specified in Rec. ITU-T X.680 | ISO/IEC 8824‑1, Rec. ITU-T X.681 | ISO/IEC 8824-2, Rec. ITU-T X.682 | ISO/IEC 8824-3, and Rec. ITU-T X.683 | ISO/IEC 8824-4, collectively referred to as Abstract Syntax Notation One or ASN.1. These basic encoding rules are also to be applied for decoding such a transfer syntax in order to identify the data values being transferred. It also specifies a set of canonical and distinguished encoding rules that restrict the encoding of values to just one of the alternatives provided by the basic encoding rules.
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)
General Information
Relations
Standards Content (Sample)
INTERNATIONAL ISO/IEC
STANDARD 8825-1
Sixth edition
2021-06
Information technology — ASN.1
encoding rules —
Part 1:
Specification of Basic Encoding Rules
(BER), Canonical Encoding Rules
(CER) and Distinguished Encoding
Rules (DER)
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)
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.690 (02/2021).
This sixth edition cancels and replaces the fifth edition (ISO/IEC 8825-1:2015), which has been
technically revised.
A list of all parts in the ISO/IEC 8825 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 . v
1 Scope . 1
2 Normative references . 1
2.1 Identical Recommendations | International Standards. 1
2.2 Additional references . 1
3 Definitions . 2
4 Abbreviations . 2
5 Notation . 3
6 Convention . 3
7 Conformance . 3
8 Basic encoding rules . 3
8.1 General rules for encoding . 3
8.1.1 Structure of an encoding . 3
8.1.2 Identifier octets . 4
8.1.3 Length octets . 5
8.1.4 Contents octets . 6
8.1.5 End-of-contents octets . 6
8.2 Encoding of a boolean value . 7
8.3 Encoding of an integer value. 7
8.4 Encoding of an enumerated value . 7
8.5 Encoding of a real value . 7
8.6 Encoding of a bitstring value . 9
8.7 Encoding of an octetstring value . 10
8.8 Encoding of a null value . 10
8.9 Encoding of a sequence value . 10
8.10 Encoding of a sequence-of value . 11
8.11 Encoding of a set value . 11
8.12 Encoding of a set-of value . 11
8.13 Encoding of a choice value . 11
8.14 Encoding of a value of a prefixed type . 11
8.15 Encoding of an open type . 12
8.16 Encoding of an instance-of value . 12
8.17 Encoding of a value of the embedded-pdv type . 13
8.18 Encoding of a value of the external type . 13
8.19 Encoding of an object identifier value . 14
8.20 Encoding of a relative object identifier value . 15
8.21 Encoding of an OID internationalized resource identifier value. 15
8.22 Encoding of a relative OID internationalized resource identifier value . 15
8.23 Encoding for values of the restricted character string types . 15
8.24 Encoding for values of the unrestricted character string type . 18
8.25 Encoding for values of the Useful Types . 18
8.26 Encoding for values of the TIME type and the useful time types . 18
8.26.1 Encoding for values of the TIME type . 18
8.26.2 Encoding for values of the DATE type . 18
8.26.3 Encoding for values of the TIME-OF-DAY type . 18
8.26.4 Encoding for values of the DATE-TIME type . 18
8.26.5 Encoding for values of the DURATION type . 18
Rec. ITU-T X.690 (02/2021) iii
© ISO/IEC 2021 – All rights reserved
9 Canonical encoding rules . 19
9.1 Length forms . 19
9.2 String encoding forms . 19
9.3 Set components. 19
10 Distinguished encoding rules . 19
10.1 Length forms . 19
10.2 String encoding forms . 20
10.3 Set components. 20
11 Restrictions on BER employed by both CER and DER . 20
11.1 Boolean values . 20
11.2 Unused bits . 20
11.3 Real values . 20
11.4 GeneralString values . 21
11.5 Set and sequence components with default value . 21
11.6 Set-of components . 21
11.7 GeneralizedTime . 21
11.8 UTCTime . 21
11.8.4 Examples of valid representations . 22
11.8.5 Examples of invalid representations . 22
11.9 The TIME type and the useful time types . 22
12 Use of BER, CER and DER in transfer syntax definition . 22
Annex A – Example of encodings. 24
A.1 ASN.1 description of the record structure . 24
A.2 ASN.1 description of a record value . 24
A.3 Representation of this record value . 24
Annex B – Identification of Encoding Rules . 26
Annex C – Illustration of real value encoding .
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.