Network Working Group                                            S. Legg
Request for Comments: 3642                           Adacel Technologies
Category: Informational                                     October 2003
        
Network Working Group                                            S. Legg
Request for Comments: 3642                           Adacel Technologies
Category: Informational                                     October 2003
        

Common Elements of Generic String Encoding Rules (GSER) Encodings

通用字符串编码规则(GSER)编码的公共元素

Status of this Memo

本备忘录的状况

This memo provides information for the Internet community. It does not specify an Internet standard of any kind. Distribution of this memo is unlimited.

本备忘录为互联网社区提供信息。它没有规定任何类型的互联网标准。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (C) The Internet Society (2003). All Rights Reserved.

版权所有(C)互联网协会(2003年)。版权所有。

Abstract

摘要

The Generic String Encoding Rules (GSER) describe a human readable text encoding for an Abstract Syntax Notation One (ASN.1) value of any ASN.1 type. Specifications making use of GSER may wish to provide an equivalent Augmented Backus-Naur Form (ABNF) description of the GSER encoding for a particular ASN.1 type as a convenience for implementors. This document supports such specifications by providing equivalent ABNF for the GSER encodings for ASN.1 types that commonly occur in Lightweight Directory Access Protocol (LDAP) syntaxes.

通用字符串编码规则(GSER)描述了任何ASN.1类型的抽象语法表示法1(ASN.1)值的人类可读文本编码。使用GSER的规范可能希望为特定ASN.1类型的GSER编码提供等效的增广巴科斯瑙形式(ABNF)描述,以方便实现者。本文档通过为ASN.1类型的GSER编码提供等效ABNF来支持此类规范,ASN.1类型通常出现在轻量级目录访问协议(LDAP)语法中。

Table of Contents

目录

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  2
   2.  Conventions. . . . . . . . . . . . . . . . . . . . . . . . . .  2
   3.  Separators . . . . . . . . . . . . . . . . . . . . . . . . . .  2
   4.  ASN.1 Built-in Types . . . . . . . . . . . . . . . . . . . . .  2
   5.  ASN.1 Restricted String Types. . . . . . . . . . . . . . . . .  7
   6.  Directory ASN.1 Types. . . . . . . . . . . . . . . . . . . . .  9
   7.  Security Considerations. . . . . . . . . . . . . . . . . . . . 10
   8.  References . . . . . . . . . . . . . . . . . . . . . . . . . . 10
       8.1.  Normative References . . . . . . . . . . . . . . . . . . 10
       8.2.  Informative References . . . . . . . . . . . . . . . . . 11
   9.  Intellectual Property Notice . . . . . . . . . . . . . . . . . 12
   10. Author's Address . . . . . . . . . . . . . . . . . . . . . . . 12
   11. Full Copyright Statement . . . . . . . . . . . . . . . . . . . 13
        
   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  2
   2.  Conventions. . . . . . . . . . . . . . . . . . . . . . . . . .  2
   3.  Separators . . . . . . . . . . . . . . . . . . . . . . . . . .  2
   4.  ASN.1 Built-in Types . . . . . . . . . . . . . . . . . . . . .  2
   5.  ASN.1 Restricted String Types. . . . . . . . . . . . . . . . .  7
   6.  Directory ASN.1 Types. . . . . . . . . . . . . . . . . . . . .  9
   7.  Security Considerations. . . . . . . . . . . . . . . . . . . . 10
   8.  References . . . . . . . . . . . . . . . . . . . . . . . . . . 10
       8.1.  Normative References . . . . . . . . . . . . . . . . . . 10
       8.2.  Informative References . . . . . . . . . . . . . . . . . 11
   9.  Intellectual Property Notice . . . . . . . . . . . . . . . . . 12
   10. Author's Address . . . . . . . . . . . . . . . . . . . . . . . 12
   11. Full Copyright Statement . . . . . . . . . . . . . . . . . . . 13
        
1. Introduction
1. 介绍

The Generic String Encoding Rules (GSER) [7] define a human readable text encoding, based on ASN.1 [8] value notation, for an ASN.1 value of any ASN.1 type. Specifications making use of GSER may wish to provide a non-normative equivalent ABNF [3] description of the GSER encoding for a particular ASN.1 type as a convenience for implementors unfamiliar with ASN.1. This document supports such specifications by providing equivalent ABNF for the GSER encodings for ASN.1 types that commonly occur in LDAP [10] or X.500 [11] attribute and assertion syntaxes, as well as equivalent ABNF for the GSER encodings for the ASN.1 built-in types.

通用字符串编码规则(GSER)[7]基于ASN.1[8]值表示法,为任何ASN.1类型的ASN.1值定义了人类可读的文本编码。使用GSER的规范可能希望为特定ASN.1类型的GSER编码提供非规范性等效ABNF[3]描述,以方便不熟悉ASN.1的实施者。本文档通过为通常出现在LDAP[10]或X.500[11]属性和断言语法中的ASN.1类型的GSER编码提供等效ABNF,以及为ASN.1内置类型的GSER编码提供等效ABNF,从而支持此类规范。

The ABNF given in this document does not replace or alter GSER in any way. If there is a discrepancy between the ABNF specified here and the encoding defined by GSER [7], then GSER is to be taken as definitive.

本文件中给出的ABNF不会以任何方式取代或改变GSER。如果此处指定的ABNF与GSER[7]定义的编码之间存在差异,则GSER将被视为最终编码。

2. Conventions
2. 习俗

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", and "MAY" in this document are to be interpreted as described in BCP 14, RFC 2119 [1]. The key word "OPTIONAL" is exclusively used with its ASN.1 meaning.

本文件中的关键词“必须”、“不得”、“要求”、“应”、“不得”、“应”、“不应”、“建议”和“可”应按照BCP 14、RFC 2119[1]中的说明进行解释。关键词“可选”仅用于其ASN.1含义。

3. Separators
3. 分离器

Certain separators are commonly used in constructing equivalent ABNF for SET and SEQUENCE types.

某些分隔符通常用于为集合和序列类型构造等价ABNF。

      sp  =  *%x20  ; zero, one or more space characters
      msp = 1*%x20  ; one or more space characters
        
      sp  =  *%x20  ; zero, one or more space characters
      msp = 1*%x20  ; one or more space characters
        
      sep = [ "," ]
        
      sep = [ "," ]
        

The <sep> rule is used in the ABNF description of the encoding for ASN.1 SET or SEQUENCE types where all the components are either OPTIONAL or DEFAULT. It encodes to an empty string if and only if the immediately preceding character in the encoding is "{", i.e., it is only empty for the first optional component actually present in the SET or SEQUENCE value being encoded.

<sep>规则用于ASN.1集合或序列类型编码的ABNF描述,其中所有组件都是可选的或默认的。当且仅当编码中的前一个字符为“{”时,即仅当编码的集合或序列值中实际存在的第一个可选组件为空时,它才编码为空字符串。

4. ASN.1 Built-in Types
4. ASN.1内置类型

This section describes the GSER encoding of values of the ASN.1 built-in types, except for the restricted character string types.

本节介绍ASN.1内置类型值的GSER编码,受限字符串类型除外。

The <BIT-STRING> rule describes the GSER encoding of values of the BIT STRING type without a named bit list.

<BIT-STRING>规则描述不带命名位列表的位字符串类型的值的GSER编码。

      BIT-STRING = bstring / hstring
        
      BIT-STRING = bstring / hstring
        

If the number of bits in a BIT STRING value is a multiple of four the <hstring> form of <BIT-STRING> MAY be used. Otherwise, the <bstring> form of <BIT-STRING> is used. The <bstring> rule encodes each bit as the character "0" or "1" in order from the first bit to the last bit. The <hstring> rule encodes each group of four bits as a hexadecimal number where the first bit is the most significant. An odd number of hexadecimal digits is permitted.

如果位字符串值中的位数是四的倍数,则可以使用<BIT-STRING>的<hstring>形式。否则,将使用<BIT-STRING>的<bstring>形式。<bstring>规则将每个位按从第一位到最后一位的顺序编码为字符“0”或“1”。<hstring>规则将每组四位编码为十六进制数,其中第一位为最高有效位。允许奇数十六进制数字。

      hstring           = squote *hexadecimal-digit squote %x48 ; '...'H
      hexadecimal-digit = %x30-39 /  ; "0" to "9"
                          %x41-46    ; "A" to "F"
        
      hstring           = squote *hexadecimal-digit squote %x48 ; '...'H
      hexadecimal-digit = %x30-39 /  ; "0" to "9"
                          %x41-46    ; "A" to "F"
        
      bstring           = squote *binary-digit squote %x42  ; '...'B
      binary-digit      = "0" / "1"
        
      bstring           = squote *binary-digit squote %x42  ; '...'B
      binary-digit      = "0" / "1"
        
      squote            =  %x27  ; ' (single quote)
        
      squote            =  %x27  ; ' (single quote)
        

The <BOOLEAN> rule describes the GSER encoding of values of the BOOLEAN type.

<BOOLEAN>规则描述布尔类型值的GSER编码。

      BOOLEAN = %x54.52.55.45 /   ; "TRUE"
                %x46.41.4C.53.45  ; "FALSE"
        
      BOOLEAN = %x54.52.55.45 /   ; "TRUE"
                %x46.41.4C.53.45  ; "FALSE"
        

The <CHARACTER-STRING> rule describes the GSER encoding of values of the associated type for the unrestricted CHARACTER STRING type.

<CHARACTER-STRING>规则描述了无限制字符串类型的关联类型值的GSER编码。

CHARACTER-STRING = "{" sp id-identification msp Identification "," sp id-data-value msp OCTET-STRING sp "}"

CHARACTER-STRING=“{”sp id identification msp identification”,“sp id数据值msp OCTET-STRING sp”}”

      id-identification = %x69.64.65.6E.74.69.66.69.63.61.74.69.6F.6E
                             ; "identification"
      id-data-value     = %x64.61.74.61.2D.76.61.6C.75.65 ; "data-value"
        
      id-identification = %x69.64.65.6E.74.69.66.69.63.61.74.69.6F.6E
                             ; "identification"
      id-data-value     = %x64.61.74.61.2D.76.61.6C.75.65 ; "data-value"
        
      Identification = ( id-syntaxes ":" Syntaxes ) /
                       ( id-syntax ":" OBJECT-IDENTIFIER ) /
                       ( id-presentation-context-id ":" INTEGER ) /
                       ( id-context-negotiation ":"
                            ContextNegotiation ) /
                       ( id-transfer-syntax ":" OBJECT-IDENTIFIER ) /
                       ( id-fixed ":" NULL )
        
      Identification = ( id-syntaxes ":" Syntaxes ) /
                       ( id-syntax ":" OBJECT-IDENTIFIER ) /
                       ( id-presentation-context-id ":" INTEGER ) /
                       ( id-context-negotiation ":"
                            ContextNegotiation ) /
                       ( id-transfer-syntax ":" OBJECT-IDENTIFIER ) /
                       ( id-fixed ":" NULL )
        
      id-syntaxes                = %x73.79.6E.74.61.78.65.73
                                      ; "syntaxes"
      id-syntax                  = %x73.79.6E.74.61.78 ; "syntax"
      id-presentation-context-id = %x70.72.65.73.65.6E.74.61.74.69.6F.6E
                                      %x2D.63.6F.6E.74.65.78.74.2D.69.64
                                      ; "presentation-context-id"
      id-context-negotiation     = %x63.6F.6E.74.65.78.74.2D.6E.65.67.6F
                                      %x74.69.61.74.69.6F.6E
                                      ; "context-negotiation"
      id-transfer-syntax         = %x74.72.61.6E.73.66.65.72.2D.73.79.6E
                                      %x74.61.78 ; "transfer-syntax"
      id-fixed                   = %x66.69.78.65.64 ; "fixed"
        
      id-syntaxes                = %x73.79.6E.74.61.78.65.73
                                      ; "syntaxes"
      id-syntax                  = %x73.79.6E.74.61.78 ; "syntax"
      id-presentation-context-id = %x70.72.65.73.65.6E.74.61.74.69.6F.6E
                                      %x2D.63.6F.6E.74.65.78.74.2D.69.64
                                      ; "presentation-context-id"
      id-context-negotiation     = %x63.6F.6E.74.65.78.74.2D.6E.65.67.6F
                                      %x74.69.61.74.69.6F.6E
                                      ; "context-negotiation"
      id-transfer-syntax         = %x74.72.61.6E.73.66.65.72.2D.73.79.6E
                                      %x74.61.78 ; "transfer-syntax"
      id-fixed                   = %x66.69.78.65.64 ; "fixed"
        
      Syntaxes = "{" sp id-abstract msp OBJECT-IDENTIFIER ","
                     sp id-transfer msp OBJECT-IDENTIFIER
                     sp "}"
      id-abstract = %x61.62.73.74.72.61.63.74 ; "abstract"
      id-transfer = %x74.72.61.6E.73.66.65.72 ; "transfer"
        
      Syntaxes = "{" sp id-abstract msp OBJECT-IDENTIFIER ","
                     sp id-transfer msp OBJECT-IDENTIFIER
                     sp "}"
      id-abstract = %x61.62.73.74.72.61.63.74 ; "abstract"
      id-transfer = %x74.72.61.6E.73.66.65.72 ; "transfer"
        

ContextNegotiation = "{" sp id-presentation-context-id msp INTEGER "," sp id-transfer-syntax msp OBJECT-IDENTIFIER sp "}"

ContextNegotiation=“{”sp id表示上下文id msp INTEGER”,“sp id传输语法msp对象标识符sp“}”

The <INTEGER> rule describes the GSER encoding of values of the INTEGER type without a named number list. The <INTEGER-0-MAX> rule describes the GSER encoding of values of the constrained type INTEGER (0..MAX). The <INTEGER-1-MAX> rule describes the GSER encoding of values of the constrained type INTEGER (1..MAX).

<INTEGER>规则描述不带命名数字列表的整型值的GSER编码。<INTEGER-0-MAX>规则描述了受约束类型INTEGER(0..MAX)值的GSER编码。<INTEGER-1-MAX>规则描述了受约束类型INTEGER(1..MAX)值的GSER编码。

      INTEGER         = "0" / positive-number / ("-" positive-number)
      INTEGER-0-MAX   = "0" / positive-number
      INTEGER-1-MAX   = positive-number
      positive-number = non-zero-digit *decimal-digit
      decimal-digit   = %x30-39  ; "0" to "9"
      non-zero-digit  = %x31-39  ; "1" to "9"
        
      INTEGER         = "0" / positive-number / ("-" positive-number)
      INTEGER-0-MAX   = "0" / positive-number
      INTEGER-1-MAX   = positive-number
      positive-number = non-zero-digit *decimal-digit
      decimal-digit   = %x30-39  ; "0" to "9"
      non-zero-digit  = %x31-39  ; "1" to "9"
        

The <EMBEDDED-PDV> rule describes the GSER encoding of values of the associated type for the EMBEDDED PDV type.

<EMBEDDED-PDV>规则描述嵌入式PDV类型的关联类型值的GSER编码。

EMBEDDED-PDV = "{" sp id-identification msp Identification "," sp id-data-value msp OCTET-STRING sp "}"

EMBEDDED-PDV=“{”sp id identification msp identification”,“sp id数据值msp OCTET-STRING sp”}”

The <EXTERNAL> rule describes the GSER encoding of values of the associated type for the EXTERNAL type.

<EXTERNAL>规则描述外部类型的关联类型的值的GSER编码。

      EXTERNAL = "{" [ sp id-direct-reference msp
                             OBJECT-IDENTIFIER "," ]
                     [ sp id-indirect-reference msp INTEGER "," ]
                     [ sp id-data-value-descriptor msp
                             ObjectDescriptor "," ]
                       sp id-encoding msp Encoding
                       sp "}"
        
      EXTERNAL = "{" [ sp id-direct-reference msp
                             OBJECT-IDENTIFIER "," ]
                     [ sp id-indirect-reference msp INTEGER "," ]
                     [ sp id-data-value-descriptor msp
                             ObjectDescriptor "," ]
                       sp id-encoding msp Encoding
                       sp "}"
        
      id-direct-reference      = %x64.69.72.65.63.74.2D.72.65.66.65.72
                                    %x65.6E.63.65
                                    ; "direct-reference"
      id-indirect-reference    = %x69.6E.64.69.72.65.63.74.2D.72.65.66
                                    %x65.72.65.6E.63.65
                                    ; "indirect-reference"
      id-data-value-descriptor = %x64.61.74.61.2D.76.61.6C.75.65.2D.64
                                    %x65.73.63.72.69.70.74.6F.72
                                    ; "data-value-descriptor"
      id-encoding              = %x65.6E.63.6F.64.69.6E.67
                                    ; "encoding"
        
      id-direct-reference      = %x64.69.72.65.63.74.2D.72.65.66.65.72
                                    %x65.6E.63.65
                                    ; "direct-reference"
      id-indirect-reference    = %x69.6E.64.69.72.65.63.74.2D.72.65.66
                                    %x65.72.65.6E.63.65
                                    ; "indirect-reference"
      id-data-value-descriptor = %x64.61.74.61.2D.76.61.6C.75.65.2D.64
                                    %x65.73.63.72.69.70.74.6F.72
                                    ; "data-value-descriptor"
      id-encoding              = %x65.6E.63.6F.64.69.6E.67
                                    ; "encoding"
        
      Encoding = ( id-single-ASN1-type ":" Value ) /
                 ( id-octet-aligned ":" OCTET-STRING ) /
                 ( id-arbitrary ":" BIT-STRING )
        
      Encoding = ( id-single-ASN1-type ":" Value ) /
                 ( id-octet-aligned ":" OCTET-STRING ) /
                 ( id-arbitrary ":" BIT-STRING )
        
      id-single-ASN1-type = %x73.69.6E.67.6C.65.2D.41.53.4E.31.2D.74.79
                               %x70.65
                               ; "single-ASN1-type"
      id-octet-aligned    = %x6F.63.74.65.74.2D.61.6C.69.67.6E.65.64
                               ; "octet-aligned"
        
      id-single-ASN1-type = %x73.69.6E.67.6C.65.2D.41.53.4E.31.2D.74.79
                               %x70.65
                               ; "single-ASN1-type"
      id-octet-aligned    = %x6F.63.74.65.74.2D.61.6C.69.67.6E.65.64
                               ; "octet-aligned"
        
      id-arbitrary        = %x61.72.62.69.74.72.61.72.79
                               ; "arbitrary"
        
      id-arbitrary        = %x61.72.62.69.74.72.61.72.79
                               ; "arbitrary"
        

The <Value> rule is defined by GSER [7]. It represents the GSER encoding of a single value of the ASN.1 type identified by the direct-reference and/or indirect-reference components.

<Value>规则由GSER[7]定义。它表示由直接引用和/或间接引用组件标识的ASN.1类型的单个值的GSER编码。

The <NULL> rule describes the GSER encoding of values of the NULL type.

<NULL>规则描述NULL类型值的GSER编码。

      NULL = %x4E.55.4C.4C  ; "NULL"
        
      NULL = %x4E.55.4C.4C  ; "NULL"
        

The <OBJECT-IDENTIFIER> rule describes the GSER encoding of values of the OBJECT IDENTIFIER type.

<OBJECT-IDENTIFIER>规则描述对象标识符类型值的GSER编码。

      OBJECT-IDENTIFIER = numeric-oid / descr
      numeric-oid       = oid-component 1*( "." oid-component )
      oid-component     = "0" / positive-number
        
      OBJECT-IDENTIFIER = numeric-oid / descr
      numeric-oid       = oid-component 1*( "." oid-component )
      oid-component     = "0" / positive-number
        

An OBJECT IDENTIFIER value is encoded using either the dotted decimal representation or an object descriptor name, i.e., <descr>. The <descr> rule is described in RFC 2252 [4]. An object descriptor name is potentially ambiguous and should be used with care.

使用点十进制表示法或对象描述符名称(即<descr>)对对象标识符值进行编码。RFC 2252[4]中描述了<descr>规则。对象描述符名称可能不明确,应谨慎使用。

The <OCTET-STRING> rule describes the GSER encoding of values of the OCTET STRING type.

<OCTET-STRING>规则描述了八进制字符串类型值的GSER编码。

      OCTET-STRING = hstring
        
      OCTET-STRING = hstring
        

The octets are encoded in order from the first octet to the last octet. Each octet is encoded as a pair of hexadecimal digits where the first digit corresponds to the four most significant bits of the octet. If the hexadecimal string does not have an even number of digits, the four least significant bits in the last octet are assumed to be zero.

八位字节按从第一个八位字节到最后一个八位字节的顺序编码。每个八位字节编码为一对十六进制数字,其中第一个数字对应于八位字节的四个最高有效位。如果十六进制字符串的位数不是偶数,则假定最后八位字节中的四个最低有效位为零。

The <REAL> rule describes the GSER encoding of values of the REAL type.

<REAL>规则描述实数类型值的GSER编码。

      REAL = "0"                    ; zero
             / PLUS-INFINITY        ; positive infinity
             / MINUS-INFINITY       ; negative infinity
             / realnumber           ; positive base 10 REAL value
             / ( "-" realnumber )   ; negative base 10 REAL value
             / real-sequence-value  ; non-zero base 2 or 10 REAL value
        
      REAL = "0"                    ; zero
             / PLUS-INFINITY        ; positive infinity
             / MINUS-INFINITY       ; negative infinity
             / realnumber           ; positive base 10 REAL value
             / ( "-" realnumber )   ; negative base 10 REAL value
             / real-sequence-value  ; non-zero base 2 or 10 REAL value
        
      PLUS-INFINITY  = %x50.4C.55.53.2D.49.4E.46.49.4E.49.54.59
                          ; "PLUS-INFINITY"
        
      PLUS-INFINITY  = %x50.4C.55.53.2D.49.4E.46.49.4E.49.54.59
                          ; "PLUS-INFINITY"
        
      MINUS-INFINITY = %x4D.49.4E.55.53.2D.49.4E.46.49.4E.49.54.59
                          ; "MINUS-INFINITY"
        
      MINUS-INFINITY = %x4D.49.4E.55.53.2D.49.4E.46.49.4E.49.54.59
                          ; "MINUS-INFINITY"
        
      realnumber = mantissa exponent
      mantissa   = (positive-number [ "." *decimal-digit ])
                   / ( "0." *("0") positive-number )
      exponent   = "E" ( "0" / ([ "-" ] positive-number))
        
      realnumber = mantissa exponent
      mantissa   = (positive-number [ "." *decimal-digit ])
                   / ( "0." *("0") positive-number )
      exponent   = "E" ( "0" / ([ "-" ] positive-number))
        
      real-sequence-value = "{" sp id-mantissa msp INTEGER ","
                                sp id-base msp ( "2" / "10" ) ","
                                sp id-exponent msp INTEGER sp "}"
      id-mantissa         = %x6D.61.6E.74.69.73.73.61 ; "mantissa"
      id-base             = %x62.61.73.65             ; "base"
      id-exponent         = %x65.78.70.6F.6E.65.6E.74 ; "exponent"
        
      real-sequence-value = "{" sp id-mantissa msp INTEGER ","
                                sp id-base msp ( "2" / "10" ) ","
                                sp id-exponent msp INTEGER sp "}"
      id-mantissa         = %x6D.61.6E.74.69.73.73.61 ; "mantissa"
      id-base             = %x62.61.73.65             ; "base"
      id-exponent         = %x65.78.70.6F.6E.65.6E.74 ; "exponent"
        

A value of the REAL type MUST be encoded as "0" if it is zero.

如果实数类型的值为零,则必须将其编码为“0”。

The <RELATIVE-OID> rule describes the GSER encoding of values of the RELATIVE-OID type.

<RELATIVE-OID>规则描述相对OID类型的值的GSER编码。

RELATIVE-OID = oid-component *( "." oid-component )

相对OID=OID组件*(“”OID组件)

5. ASN.1 Restricted String Types
5. ASN.1受限字符串类型

This section describes the GSER encoding of values of the ASN.1 restricted character string types. The characters of a value of a restricted character string type are always encoded as a UTF-8 character string between double quotes. For some of the ASN.1 string types, this requires a translation to or from the UTF-8 encoding. Some of the ASN.1 string types permit only a subset of the characters representable in UTF-8. Any double quote characters in the character string, where allowed by the character set, are escaped by being repeated.

本节描述ASN.1受限字符串类型值的GSER编码。受限字符串类型的值的字符始终编码为双引号之间的UTF-8字符串。对于某些ASN.1字符串类型,这需要与UTF-8编码进行转换。一些ASN.1字符串类型只允许UTF-8中可表示的字符的子集。在字符集允许的情况下,字符串中的任何双引号字符都将通过重复进行转义。

The <UTF8String> rule describes the GSER encoding of values of the UTF8String type. The characters of this string type do not require any translation before being encoded.

<UTF8String>规则描述UTF8String类型值的GSER编码。此字符串类型的字符在编码之前不需要任何翻译。

UTF8String = StringValue StringValue = dquote *SafeUTF8Character dquote

UTF8String=StringValue StringValue=dquote*安全UTF8character dquote

      dquote            = %x22 ; " (double quote)
        
      dquote            = %x22 ; " (double quote)
        
      SafeUTF8Character = %x00-21 / %x23-7F /   ; ASCII minus dquote
                          dquote dquote /       ; escaped double quote
                          %xC0-DF %x80-BF /     ; 2 byte UTF-8 character
                          %xE0-EF 2(%x80-BF) /  ; 3 byte UTF-8 character
                          %xF0-F7 3(%x80-BF)    ; 4 byte UTF-8 character
        
      SafeUTF8Character = %x00-21 / %x23-7F /   ; ASCII minus dquote
                          dquote dquote /       ; escaped double quote
                          %xC0-DF %x80-BF /     ; 2 byte UTF-8 character
                          %xE0-EF 2(%x80-BF) /  ; 3 byte UTF-8 character
                          %xF0-F7 3(%x80-BF)    ; 4 byte UTF-8 character
        

The <NumericString>, <PrintableString>, <VisibleString>, <ISO646String>, <IA5String>, <GeneralizedTime> and <UTCTime> rules describe the GSER encoding of values of the correspondingly named ASN.1 types. The characters of these string types are compatible with UTF-8 and do not require any translation before being encoded. The GeneralizedTime and UTCTime types use the VisibleString character set, but have a strictly defined format.

<NumericString>、<PrintableString>、<VisibleString>、<ISO646String>、<IA5String>、<GeneralizedTime>和<UTCTime>规则描述了相应命名的ASN.1类型值的GSER编码。这些字符串类型的字符与UTF-8兼容,编码前不需要任何翻译。泛化时间和UTCTime类型使用VisibleString字符集,但具有严格定义的格式。

      NumericString        = dquote *(decimal-digit / space) dquote
      space                = %x20
        
      NumericString        = dquote *(decimal-digit / space) dquote
      space                = %x20
        
      PrintableString      = dquote *PrintableCharacter dquote
      PrintableCharacter   = decimal-digit / space
                             / %x41-5A ; A to Z
                             / %x61-7A ; a to z
                             / %x27-29 ; ' ( )
                             / %x2B-2F ; + , - . /
                             / %x3A    ; :
                             / %x3D    ; =
                             / %x3F    ; ?
        
      PrintableString      = dquote *PrintableCharacter dquote
      PrintableCharacter   = decimal-digit / space
                             / %x41-5A ; A to Z
                             / %x61-7A ; a to z
                             / %x27-29 ; ' ( )
                             / %x2B-2F ; + , - . /
                             / %x3A    ; :
                             / %x3D    ; =
                             / %x3F    ; ?
        
      ISO646String         = VisibleString
      VisibleString        = dquote *SafeVisibleCharacter dquote
      SafeVisibleCharacter = %x20-21
                             / %x23-7E ; printable ASCII minus dquote
                             / dquote dquote   ; escaped double quote
        
      ISO646String         = VisibleString
      VisibleString        = dquote *SafeVisibleCharacter dquote
      SafeVisibleCharacter = %x20-21
                             / %x23-7E ; printable ASCII minus dquote
                             / dquote dquote   ; escaped double quote
        
      IA5String            = dquote *SafeIA5Character dquote
      SafeIA5Character     = %x00-21 / %x23-7F ; ASCII minus dquote
                             / dquote dquote   ; escaped double quote
        
      IA5String            = dquote *SafeIA5Character dquote
      SafeIA5Character     = %x00-21 / %x23-7F ; ASCII minus dquote
                             / dquote dquote   ; escaped double quote
        
      century = 2(%x30-39) ; "00" to "99"
      year    = 2(%x30-39) ; "00" to "99"
      month   =   ( %x30 %x31-39 ) ; "01" (January) to "09"
                / ( %x31 %x30-32 ) ; "10" to "12"
      day     =   ( %x30 %x31-39 )    ; "01" to "09"
                / ( %x31-32 %x30-39 ) ; "10" to "29"
                / ( %x32 %x30-31 )    ; "30" to "31"
      hour    = ( %x30-31 %x30-39 ) / ( %x32 %x30-33 ) ; "00" to "23"
      minute  = %x30-35 %x30-39                        ; "00" to "59"
      second  =   ( %x30-35 %x30-39 )  ; "00" to "59"
                / ( %x36 %x30 )        ; "60" (a leap second)
        
      century = 2(%x30-39) ; "00" to "99"
      year    = 2(%x30-39) ; "00" to "99"
      month   =   ( %x30 %x31-39 ) ; "01" (January) to "09"
                / ( %x31 %x30-32 ) ; "10" to "12"
      day     =   ( %x30 %x31-39 )    ; "01" to "09"
                / ( %x31-32 %x30-39 ) ; "10" to "29"
                / ( %x32 %x30-31 )    ; "30" to "31"
      hour    = ( %x30-31 %x30-39 ) / ( %x32 %x30-33 ) ; "00" to "23"
      minute  = %x30-35 %x30-39                        ; "00" to "59"
      second  =   ( %x30-35 %x30-39 )  ; "00" to "59"
                / ( %x36 %x30 )        ; "60" (a leap second)
        
      UTCTime         = dquote year month day hour minute [ second ]
                           [ %x5A / u-differential ] dquote
      u-differential  = ( "-" / "+" ) hour minute
        
      UTCTime         = dquote year month day hour minute [ second ]
                           [ %x5A / u-differential ] dquote
      u-differential  = ( "-" / "+" ) hour minute
        
      GeneralizedTime = dquote century year month day hour
                           [ minute [ second ] ] [ fraction ]
                           [ %x5A / g-differential ] dquote
      fraction        = ( "." / "," ) 1*(%x30-39)
      g-differential  = ( "-" / "+" ) hour [ minute ]
        
      GeneralizedTime = dquote century year month day hour
                           [ minute [ second ] ] [ fraction ]
                           [ %x5A / g-differential ] dquote
      fraction        = ( "." / "," ) 1*(%x30-39)
      g-differential  = ( "-" / "+" ) hour [ minute ]
        

The <BMPString> and <UniversalString> rules describe the GSER encoding of values of the BMPString and UniversalString types respectively. BMPString (UCS-2) and UniversalString (UCS-4) values are translated into UTF-8 [6] character strings before being encoded according to <StringValue>.

<BMPString>和<UniversalString>规则分别描述BMPString和UniversalString类型的值的GSER编码。BMPString(UCS-2)和UniversalString(UCS-4)值在根据<StringValue>进行编码之前被转换为UTF-8[6]字符串。

BMPString = StringValue UniversalString = StringValue

BMPString=StringValue-UniversalString=StringValue

The <TeletexString>, <T61String>, <VideotexString>, <GraphicString>, <GeneralString> and <ObjectDescriptor> rules describe the GSER encoding of values of the correspondingly named ASN.1 types. Values of these string types are translated into UTF-8 character strings before being encoded according to <StringValue>. The ObjectDescriptor type uses the GraphicString character set.

<TeletextString>、<T61String>、<VideotexString>、<GraphicsString>、<GeneralString>和<ObjectDescriptor>规则描述了相应命名的ASN.1类型值的GSER编码。这些字符串类型的值在根据<StringValue>编码之前被转换为UTF-8字符串。ObjectDescriptor类型使用GraphicsString字符集。

TeletexString = StringValue T61String = StringValue VideotexString = StringValue GraphicString = StringValue GeneralString = StringValue ObjectDescriptor = GraphicString

TeletextString=StringValue T61String=StringValue VideotexString=StringValue GraphicsString=StringValue GeneralString=StringValue ObjectDescriptor=GraphicsString

6. Directory ASN.1 Types
6. 目录ASN.1类型

This section describes the GSER encoding of values of selected ASN.1 types defined for LDAP and X.500. The ABNF rule names beginning with uppercase letters describe the GSER encoding of values of the ASN.1 type with the same name.

本节描述为LDAP和X.500定义的选定ASN.1类型的值的GSER编码。以大写字母开头的ABNF规则名称描述了ASN.1类型值的GSER编码。

      AttributeType  = OBJECT-IDENTIFIER
        
      AttributeType  = OBJECT-IDENTIFIER
        

The characters of a DirectoryString are translated into UTF-8 characters as required before being encoded between double quotes with any embedded double quotes escaped by being repeated.

DirectoryString的字符根据需要翻译成UTF-8字符,然后在双引号之间进行编码,任何嵌入的双引号通过重复转义而转义。

      DirectoryString = StringValue /
                        ( id-teletexString   ":" TeletexString ) /
                        ( id-printableString ":" PrintableString ) /
                        ( id-bmpString       ":" BMPString ) /
                        ( id-universalString ":" UniversalString ) /
                        ( id-uTF8String      ":" UTF8String )
        
      DirectoryString = StringValue /
                        ( id-teletexString   ":" TeletexString ) /
                        ( id-printableString ":" PrintableString ) /
                        ( id-bmpString       ":" BMPString ) /
                        ( id-universalString ":" UniversalString ) /
                        ( id-uTF8String      ":" UTF8String )
        
      id-teletexString   = %x74.65.6C.65.74.65.78.53.74.72.69.6E.67
                              ; "teletexString"
      id-printableString = %x70.72.69.6E.74.61.62.6C.65
                              %x53.74.72.69.6E.67 ; "printableString"
      id-bmpString       = %x62.6D.70.53.74.72.69.6E.67 ; "bmpString"
      id-universalString = %x75.6E.69.76.65.72.73.61.6C
                              %x53.74.72.69.6E.67 ; "universalString"
      id-uTF8String      = %x75.54.46.38.53.74.72.69.6E.67
                                 ; "uTF8String"
        
      id-teletexString   = %x74.65.6C.65.74.65.78.53.74.72.69.6E.67
                              ; "teletexString"
      id-printableString = %x70.72.69.6E.74.61.62.6C.65
                              %x53.74.72.69.6E.67 ; "printableString"
      id-bmpString       = %x62.6D.70.53.74.72.69.6E.67 ; "bmpString"
      id-universalString = %x75.6E.69.76.65.72.73.61.6C
                              %x53.74.72.69.6E.67 ; "universalString"
      id-uTF8String      = %x75.54.46.38.53.74.72.69.6E.67
                                 ; "uTF8String"
        

The <RDNSequence> rule describes the GSER encoding of values of the RDNSequence type, which is syntactically equivalent to the DistinguishedName and LocalName types. The <RDNSequence> rule encodes a name as an LDAPDN character string between double quotes. The character string is first derived according to the <distinguishedName> rule in Section 3 of RFC 2253 [5], and then it is encoded between double quotes with any embedded double quotes escaped by being repeated.

<RDNSequence>规则描述RDNSequence类型的值的GSER编码,该编码在语法上等同于distincidencedname和LocalName类型。<RDNSequence>规则将名称编码为双引号之间的LDAPDN字符串。首先根据RFC 2253[5]第3节中的<DiscriminatedName>规则导出字符串,然后在双引号之间对其进行编码,其中任何嵌入的双引号通过重复转义。

DistinguishedName = RDNSequence LocalName = RDNSequence RDNSequence = dquote *SafeUTF8Character dquote

DifferentiedName=RDNSequence LocalName=RDNSequence RDNSequence=dquote*SafeUTF8Character dquote

The <RelativeDistinguishedName> rule describes the GSER encoding of values of the RelativeDistinguishedName type that are not part of an RDNSequence value. The <RelativeDistinguishedName> rule encodes an RDN as a double quoted string containing the RDN as it would appear in an LDAPDN character string. The character string is first derived according to the <name-component> rule in Section 3 of RFC 2253 [5], and then any embedded double quote characters are escaped by being repeated. This resulting string is output between double quotes.

<RelativeDistinguishedName>规则描述了不属于RDNSequence值一部分的RelativeDistinguishedName类型的值的GSER编码。<RelativeDistinguishedName>规则将RDN编码为包含RDN的双引号字符串,就像它出现在LDAPDN字符串中一样。首先根据RFC 2253[5]第3节中的<name component>规则导出字符串,然后通过重复对任何嵌入的双引号字符进行转义。此结果字符串在双引号之间输出。

RelativeDistinguishedName = dquote *SafeUTF8Character dquote

RelativeDistinguishedName=dquote*SafeUTF8Character dquote

The <ORAddress> rule encodes an X.400 address as an IA5 character string between double quotes. The character string is first derived according to Section 4.1 of RFC 2156 [2], and then any embedded double quotes are escaped by being repeated. This resulting string is output between double quotes.

<ORAddress>规则将X.400地址编码为双引号之间的IA5字符串。首先根据RFC 2156[2]的第4.1节导出字符串,然后通过重复对任何嵌入的双引号进行转义。此结果字符串在双引号之间输出。

ORAddress = dquote *SafeIA5Character dquote

ORAddress=dquote*SafeA5Character dquote

7. Security Considerations
7. 安全考虑

This document contains an alternative description of parts of the Generic String Encoding Rules, but does not replace or alter GSER in any way. For the full security implications of using GSER, see the Security Considerations section for GSER [7].

本文档包含通用字符串编码规则部分的替代说明,但不以任何方式替换或更改GSER。有关使用GSER的全部安全含义,请参阅GSER的安全注意事项部分[7]。

8. References
8. 工具书类
8.1. Normative References
8.1. 规范性引用文件

[1] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[1] Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[2] Kille, S., "MIXER (Mime Internet X.400 Enhanced Relay): Mapping between X.400 and RFC 822/MIME", RFC 2156, January 1998.

[2] Kille,S.,“混音器(Mime互联网X.400增强中继):X.400和RFC 822/Mime之间的映射”,RFC 2156,1998年1月。

[3] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997.

[3] Crocker,D.和P.Overell,“语法规范的扩充BNF:ABNF”,RFC 2234,1997年11月。

[4] Wahl, M., Coulbeck, A., Howes, T. and S. Kille, "Lightweight Directory Access Protocol (v3): Attribute Syntax Definitions", RFC 2252, December 1997.

[4] Wahl,M.,Coulbeck,A.,Howes,T.和S.Kille,“轻量级目录访问协议(v3):属性语法定义”,RFC2252,1997年12月。

[5] Wahl, M., Kille, S. and T. Howes, "Lightweight Directory Access Protocol (v3): UTF-8 String Representation of Distinguished Names", RFC 2253, December 1997.

[5] Wahl,M.,Kille,S.和T.Howes,“轻量级目录访问协议(v3):可分辨名称的UTF-8字符串表示”,RFC 2253,1997年12月。

[6] Yergeau, F., "UTF-8, a transformation format of ISO 10646", RFC 2279, January 1998.

[6] “UTF-8,ISO 10646的转换格式”,RFC 2279,1998年1月。

[7] Legg, S., "Generic String Encoding Rules (GSER) for ASN.1 Types", RFC 3641, October 2003.

[7] Legg,S.,“ASN.1类型的通用字符串编码规则(GSER)”,RFC3641,2003年10月。

   [8]  ITU-T Recommendation X.680 (07/02) | ISO/IEC 8824-1:2002
        Information technology - Abstract Syntax Notation One (ASN.1):
        Specification of basic notation
        
   [8]  ITU-T Recommendation X.680 (07/02) | ISO/IEC 8824-1:2002
        Information technology - Abstract Syntax Notation One (ASN.1):
        Specification of basic notation
        
8.2. Informative References
8.2. 资料性引用

[9] Hovey, R. and S. Bradner, "The Organizations Involved in the IETF Standards Process", BCP 11, RFC 2028, October 1996.

[9] Hovey,R.和S.Bradner,“参与IETF标准过程的组织”,BCP 11,RFC 2028,1996年10月。

[10] Hodges, J. and R. Morgan, "Lightweight Directory Access Protocol (v3): Technical Specification", RFC 3377, September 2002.

[10] Hodges,J.和R.Morgan,“轻量级目录访问协议(v3):技术规范”,RFC3372002年9月。

   [11] ITU-T Recommendation X.500 (1993) | ISO/IEC 9594-1:1994,
        Information Technology - Open Systems Interconnection - The
        Directory: Overview of concepts, models and services
        
   [11] ITU-T Recommendation X.500 (1993) | ISO/IEC 9594-1:1994,
        Information Technology - Open Systems Interconnection - The
        Directory: Overview of concepts, models and services
        
9. Intellectual Property Notice
9. 知识产权公告

The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification can be obtained from the IETF Secretariat.

IETF对可能声称与本文件所述技术的实施或使用有关的任何知识产权或其他权利的有效性或范围,或此类权利下的任何许可可能或可能不可用的程度,不采取任何立场;它也不表示它已作出任何努力来确定任何此类权利。有关IETF在标准跟踪和标准相关文件中权利的程序信息,请参见BCP-11。可从IETF秘书处获得可供发布的权利声明副本和任何许可证保证,或本规范实施者或用户试图获得使用此类专有权利的一般许可证或许可的结果。

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address the information to the IETF Executive Director.

IETF邀请任何相关方提请其注意任何版权、专利或专利申请,或其他可能涉及实施本标准所需技术的专有权利。请将信息发送给IETF执行董事。

10. Author's Address
10. 作者地址

Steven Legg Adacel Technologies Ltd. 250 Bay Street Brighton, Victoria 3186 AUSTRALIA

Steven Legg Adacel Technologies Ltd.澳大利亚维多利亚州布莱顿湾街250号,邮编:3186

   Phone: +61 3 8530 7710
   Fax:   +61 3 8530 7888
   EMail: steven.legg@adacel.com.au
        
   Phone: +61 3 8530 7710
   Fax:   +61 3 8530 7888
   EMail: steven.legg@adacel.com.au
        
11. Full Copyright Statement
11. 完整版权声明

Copyright (C) The Internet Society (2003). All Rights Reserved.

版权所有(C)互联网协会(2003年)。版权所有。

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

本文件及其译本可复制并提供给他人,对其进行评论或解释或协助其实施的衍生作品可全部或部分编制、复制、出版和分发,不受任何限制,前提是上述版权声明和本段包含在所有此类副本和衍生作品中。但是,不得以任何方式修改本文件本身,例如删除版权通知或对互联网协会或其他互联网组织的引用,除非出于制定互联网标准的需要,在这种情况下,必须遵循互联网标准过程中定义的版权程序,或根据需要将其翻译成英语以外的其他语言。

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assignees.

上述授予的有限许可是永久性的,互联网协会或其继承人或受让人不会撤销。

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

本文件和其中包含的信息是按“原样”提供的,互联网协会和互联网工程任务组否认所有明示或暗示的保证,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。

Acknowledgement

确认

Funding for the RFC Editor function is currently provided by the Internet Society.

RFC编辑功能的资金目前由互联网协会提供。