draft-ietf-ldapbis-dn-05.txt   draft-ietf-ldapbis-dn-06.txt 
INTERNET-DRAFT Editor: Kurt D. Zeilenga INTERNET-DRAFT Editor: Kurt D. Zeilenga
Intended Category: Standard Track OpenLDAP Foundation Intended Category: Standard Track OpenLDAP Foundation
Expires: 29 October 2001 29 April 2001 Expires: 20 January 2002 20 July 2001
Obsoletes: 2253 Obsoletes: 2253
Lightweight Directory Access Protocol (v3): Lightweight Directory Access Protocol (v3):
UTF-8 String Representation of Distinguished Names UTF-8 String Representation of Distinguished Names
<draft-ietf-ldapbis-dn-05.txt> <draft-ietf-ldapbis-dn-06.txt>
Status of Memo Status of Memo
This document is an Internet-Draft and is in full conformance with all This document is an Internet-Draft and is in full conformance with all
provisions of Section 10 of RFC2026. provisions of Section 10 of RFC2026.
This document is intended to be, after appropriate review and This document is intended to be, after appropriate review and
revision, submitted to the RFC Editor as a Standard Track document revision, submitted to the RFC Editor as a Standard Track document
replacing RFC 2253. Distribution of this memo is unlimited. replacing RFC 2253. Distribution of this memo is unlimited.
Technical discussion of this document will take place on the IETF LDAP Technical discussion of this document will take place on the IETF LDAP
skipping to change at page 2, line 44 skipping to change at page 2, line 44
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
RelativeDistinguishedName ::= SET SIZE (1..MAX) OF RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
AttributeTypeAndValue AttributeTypeAndValue
AttributeTypeAndValue ::= SEQUENCE { AttributeTypeAndValue ::= SEQUENCE {
type AttributeType, type AttributeType,
value AttributeValue } value AttributeValue }
The following sections define the algorithm for converting from an The following sections define the RECOMMENDED algorithm for converting
ASN.1 structured representation to a UTF-8 [RFC2279] string from an ASN.1 structured representation to a UTF-8 [RFC2279] string
representation. representation.
2.1. Converting the RDNSequence 2.1. Converting the RDNSequence
If the RDNSequence is an empty sequence, the result is the empty or If the RDNSequence is an empty sequence, the result is the empty or
zero length string. zero length string.
Otherwise, the output consists of the string encodings of each Otherwise, the output consists of the string encodings of each
RelativeDistinguishedName in the RDNSequence (according to 2.2), RelativeDistinguishedName in the RDNSequence (according to 2.2),
starting with the last element of the sequence and moving backwards starting with the last element of the sequence and moving backwards
toward the first. toward the first.
skipping to change at page 4, line 12 skipping to change at page 4, line 12
STREET streetAddress (2.5.4.9) STREET streetAddress (2.5.4.9)
DC domainComponent (0.9.2342.19200300.100.1.25) DC domainComponent (0.9.2342.19200300.100.1.25)
UID userId (0.9.2342.19200300.100.1.1) UID userId (0.9.2342.19200300.100.1.1)
2.4. Converting an AttributeValue from ASN.1 to a String 2.4. Converting an AttributeValue from ASN.1 to a String
If the AttributeValue is of a type which does not have a string If the AttributeValue is of a type which does not have a string
representation defined for it, then it is simply encoded as an representation defined for it, then it is simply encoded as an
octothorpe character ('#' ASCII 35) followed by the hexadecimal octothorpe character ('#' ASCII 35) followed by the hexadecimal
representation of each of the octets of the BER encoding of the X.500 representation of each of the octets of the BER encoding of the X.500
AttributeValue. This form SHOULD also be used if the AttributeType is AttributeValue. This form is also be used if the AttributeType is of
of the dotted-decimal form. the dotted-decimal form.
Otherwise, if the AttributeValue is of a type which has a string Otherwise, if the AttributeValue is of a type which has a string
representation, the value is converted first to a UTF-8 string representation, the value is converted first to a UTF-8 string
according to its syntax specification (see for example Section 6 of according to its syntax specification (see for example Section 6 of
[RFC2252bis]). [RFC2252bis]).
If the UTF-8 string does not have any of the following characters If the UTF-8 string does not have any of the following characters
which need escaping, then that string can be used as the string which need escaping, then that string can be used as the string
representation of the value. representation of the value.
- a space (' ' ASCII 32) or octothorpe ('#' ASCII 35) occurring at - a space (' ' ASCII 32) or octothorpe ('#' ASCII 35) occurring at
the beginning of the string the beginning of the string
- a space (' ' ASCII 32) character occurring at the end of the - a space (' ' ASCII 32) character occurring at the end of the
string string
- one of the characters ",", "+", """, "\", "<", ">" or ";" (ASCII - one of the characters ",", "+", """, "\", "<", ">" or ";" (ASCII
44, 43, 34, 92, 60, 62, or 59, respectively) 44, 43, 34, 92, 60, 62, or 59, respectively)
Implementations MAY escape other characters. - the null (ASCII 0) character
Implementations can escape other characters.
Each octet of the character to be escaped is replaced by a backslash Each octet of the character to be escaped is replaced by a backslash
and two hex digits, which form a single octet in the code of the and two hex digits, which form a single octet in the code of the
character. Alternatively, if and only if the character to be escaped character. Alternatively, if and only if the character to be escaped
is one of is one of
",", "+", """, "\", "<", ">", ";", "#", "=", or " " ",", "+", """, "\", "<", ">", ";", "#", "=", or " "
(ASCII 44, 43, 34, 92, 60, 62, 59, 35, or 32, respectively) (ASCII 44, 43, 34, 92, 60, 62, 59, 35, or 32, respectively)
it may be prefixed by a backslash ('\' ASCII 92). it can be prefixed by a backslash ('\' ASCII 92).
Examples of the escaping mechanism are shown in Section 4. Examples of the escaping mechanism are shown in Section 4.
3. Parsing a String back to a Distinguished Name 3. Parsing a String back to a Distinguished Name
The structure of the UTF-8 [RFC2279] string is specified using the The structure of the UTF-8 [RFC2279] string is specified using the
following Augmented BNF [RFC2234] grammar. following Augmented BNF [RFC2234] grammar.
distinguishedName = [name] distinguishedName = [name]
; may be empty ; may be empty
name = name-component *(COMMA name-component) name = name-component *(COMMA name-component)
name-component = attributeTypeAndValue *(PLUS attributeTypeAndValue) name-component = attributeTypeAndValue *(PLUS attributeTypeAndValue)
skipping to change at page 5, line 33 skipping to change at page 5, line 34
number = ( LDIGIT *DIGIT ) / DIGIT number = ( LDIGIT *DIGIT ) / DIGIT
attributeValue = string / hexstring attributeValue = string / hexstring
string = *( stringchar / pair ) string = *( stringchar / pair )
; the string MUST NOT start with SHARP or SP ; the string MUST NOT start with SHARP or SP
; and MUST NOT end with SP ; and MUST NOT end with SP
stringchar = <any UTF-8 character (can be multiple octets) stringchar = <any UTF-8 character (can be multiple octets)
except one of escaped or ESC> except one of escaped or ESC or NULL>
pair = ESC ( ESC / special / hexpair ) pair = ESC ( ESC / special / hexpair )
special = escaped / SHARP / EQUALS / SP special = escaped / SHARP / EQUALS / SP
escaped = COMMA / PLUS / %x22 / %x3C / %x3E / %x3B escaped = COMMA / PLUS / %x22 / %x3C / %x3E / %x3B
; "," / "+" / """ / "<" / ">" / ";" ; "," / "+" / """ / "<" / ">" / ";"
hexstring = SHARP 1*hexpair hexstring = SHARP 1*hexpair
skipping to change at page 6, line 11 skipping to change at page 6, line 11
ALPHA = %x41-5A / %x61-7A ALPHA = %x41-5A / %x61-7A
; A-Z / a-z ; A-Z / a-z
LDIGIT = %x31-39 LDIGIT = %x31-39
; 1-9 ; 1-9
DIGIT = %x30 / LDIGIT DIGIT = %x30 / LDIGIT
; 0-9 ; 0-9
SP = %x20 ; space (" ") SP = %x20 ; space (" ")
SHARP = %x23 ; sharp sign ("#") SHARP = %x23 ; octothorpe (or sharp sign) ("#")
PLUS = %x2B ; plus sign ("+") PLUS = %x2B ; plus sign ("+")
COMMA = %x2C ; comma (",") COMMA = %x2C ; comma (",")
MINUS = %x2D ; minus sign ("-") MINUS = %x2D ; minus sign ("-")
DOT = %x2E ; period (".") DOT = %x2E ; period (".")
EQUALS = %x3D ; equals sign ("=") EQUALS = %x3D ; equals sign ("=")
ESC = %x5C ; backslash ("\") ESC = %x5C ; backslash ("\")
NULL = %x00 ; null (0)
Implementations MUST recognize AttributeType string type names Implementations MUST recognize AttributeType string type names
(keywords) listed in the Section 2.3 table, but MAY recognize other (keywords) listed in the Section 2.3 table, but MAY recognize other
names. Implementations MAY recognize other DN string representations names. Implementations MAY recognize other DN string representations
(such as that described in RFC 1779). As there is no requirement for (such as that described in RFC 1779). As there is no requirement for
other names or alternative DN string representations be recognized, other names or alternative DN string representations to be recognized,
implementations SHOULD only generate DN strings in accordance with implementations SHOULD only generate DN strings in accordance with
Section 2 of this document. Section 2 of this document.
4. Examples 4. Examples
This notation is designed to be convenient for common forms of name. This notation is designed to be convenient for common forms of name.
This section gives a few examples of distinguished names written using This section gives a few examples of distinguished names written using
this notation. First is a name containing three relative this notation. First is a name containing three relative
distinguished names (RDNs): distinguished names (RDNs):
UID=jsmith,DC=example,DC=net UID=jsmith,DC=example,DC=net
Here is an example name containing three RDNs, in which the first RDN Here is an example name containing three RDNs, in which the first RDN
is multi-valued: is multi-valued:
OU=Sales+CN=J. Smith,DC=example,DC=net OU=Sales+CN=J. Smith,DC=example,DC=net
This example shows the method of quoting of a comma in a common name: This example shows the method of escaping of a comma in a common name:
CN=John Smith\, III,DC=example,DC=net CN=John Smith\, III,DC=example,DC=net
An example name in which a value contains a carriage return character: An example name in which a value contains a carriage return character:
CN=Before\0dAfter,DC=example,DC=net CN=Before\0dAfter,DC=example,DC=net
An example name in which an RDN was of an unrecognized type. The An example name in which an RDN was of an unrecognized type. The
value is the BER encoding of an OCTET STRING containing two octets value is the BER encoding of an OCTET STRING containing two octets
0x48 and 0x69. 0x48 and 0x69.
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/