RFC 1485 HISTORIC DIRECTORY · NAMING · SYNTAX

A String Representation of Distinguished Names (OSI-DS 23 (v5))

A readable text format for writing down an X.500 directory name, such as on a business card or in an email.

On rfc-editor.org ↗
PUBLISHED
July 1993
AUTHORS
S. Hardcastle-Kille
STREAM
IETF
OBSOLETED BY
RFC 1779 — LDAP DN strings, RFC 3494 — LDAPv2 to Historic
REQUIRED KEYWORDS
CN, L, ST, O, OU, C
SEPARATORS
comma or semicolon
MULTI-VALUED RDN
joined with +
DOTTED TYPE ESCAPE
OID.2.6.53 (example)
HEX VALUE ESCAPE
#0A56CF (example)
DOI
10.17487/RFC1485

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Network Working Group                               S. Hardcastle-Kille
Request for Comments: 1485                             ISODE Consortium
                                                              July 1993


             A String Representation of Distinguished Names
                            (OSI-DS 23 (v5))

Status of this Memo

   This RFC specifies an IAB standards track protocol for the Internet
   community, and requests discussion and suggestions for improvements.
   Please refer to the current edition of the "IAB Official Protocol
   Standards" for the standardization state and status of this protocol.
   Distribution of this memo is unlimited.

Abstract

   The OSI Directory uses distinguished names as the primary keys to
   entries in the directory.  Distinguished Names are encoded in ASN.1.
   When a distinguished name is communicated between to users not using a
   directory protocol (e.g., in a mail message), there is a need to have
   a user-oriented string representation of distinguished name.  This
   specification defines a string format for representing names, which is
   designed to give a clean representation of commonly used names, whilst
   being able to represent any distinguished name.  Please send comments
   to the author or to the discussion group <osi-ds@CS.UCL.AC.UK>.

Table of Contents

   1.  Why a notation is needed...................................... 1
   2.  A notation for Distinguished Name............................. 2
   2.1 Goals......................................................... 2
   2.2 Informal definition........................................... 2
   2.3 Formal definition............................................. 3
   3.  Examples...................................................... 6
   4.  References.................................................... 6
   5.  Security Considerations....................................... 6
   6.  Author's Address.............................................. 7

1.  Why a notation is needed

   Many OSI Applications make use of Distinguished Names (DN) as defined
   in the OSI Directory, commonly known as X.500 [CCI88].  This
   specification assumes familiarity with X.500, and the concept of
   Distinguished Name.  It is important to have a common format to be
   able to unambiguously represent a distinguished name.  This might be
   done to represent a directory name on a business card or in an email
   message.  There is a need for a format to support human to human
   communication, which must be string based (not ASN.1) and user
   oriented.  This notation is targeted towards a general user oriented
   system, and in particular to represent the names of humans.  Other
   syntaxes may be more appropriate for other uses of the directory.
   For example, the OSF Syntax may be more appropriate for some system
   oriented uses.  (The OSF Syntax uses "/" as a separator, and forms
   names in a manner intended to resemble UNIX filenames).

2.  A notation for Distinguished Name

2.1 Goals

   The following goals are laid out:

      o  To provide an unambiguous representation of a distinguished
         name

      o  To be an intuitive format for the majority of names

      o  To be fully general, and able to represent any distinguished
         name

      o  To be amenable to a number of different layouts to achieve an
          attractive representation.

      o  To give a clear representation of the contents of the
          distinguished name

2.2 Informal definition

   This notation is designed to be convenient for common forms of name.
   Some examples are given.  The author's directory distinguished name
   would be written:

      CN=Steve Hardcastle-Kille, OU=Computer Science, O=University
      College London, C=GB

   This may be folded, perhaps to display in multi-column format.  For
   example:

      CN=Steve Hardcastle-Kille,
      OU=Computer Science,
      O=University College London,
      C=GB
   Another name might be:

      CN=Christian Huitema, O=INRIA, C=FR

   Semicolon (";") may be used as an alternate separator.

      CN=Christian Huitema; O=INRIA; C=FR

   In running text, this would be written as <CN=Christian Huitema;
   O=INRIA; C=FR>.  Another example, shows how different attribute types
   are handled:

      CN=James Hacker,
      L=Basingstoke,
      O=Widget Inc,
      CN=GB

   Here is an example of a multi-valued Relative Distinguished Name,
   where the namespace is flat within an organisation, and department is
   used to disambiguate certain names:

      OU=Sales + CN=J. Smith, O=Widget Inc., C=US

   The final example shows quoting of a comma in an Organisation name:

      CN=L. Eagle, O="Sue, Grabbit and Runn", C=GB

2.3 Formal definition

   A formal definition can now be given.  The structure is specified in
   a BNF grammar in Figure 1.  This BNF uses the grammar defined in RFC
   822, with the terminals enclosed in <> [Cro82].  This definition is
   in an abstract character set, and so may be written in any character
   set supporting the explicitly defined special characters.  The
   quoting mechanism is used for the following cases:

      o  Strings containing ",", "+", "="or """, <CR>, "<",
         ">", "#", or ";".

      o  Strings with leading or trailing spaces

      o  Strings containing consecutive spaces

   There is an escape mechanism from the normal user oriented form, so
   that this syntax may be used to print any valid distinguished name.
   This is ugly.  It is expected to be used only in pathological cases.
   There are two parts to this mechanism:

      1.  Attributes types are represented in a (big-endian) dotted
          notation.  (e.g., OID.2.6.53).

      2.  Attribute values are represented in hexadecimal
          (e.g.,  #0A56CF).

   The keyword specification is optional in the BNF, but mandatory for
   this specification.  This is so that the same BNF may be used for the
   related specification on User Friendly Naming [HK93].  When this
   specification is followed, the attribute type keywords must always be
   present.  A list of valid keywords for well known attribute types
   used in naming is given in Table 1.  This is a list of keywords which
   must be supported.  These are chosen because they appear in common
   forms of name, and can do so in a place which does not correspond to
   the default schema used.  A register of valid keyworkds is maintained
   by the IANA.

   Only string type attributes are considered, but other attribute
   syntaxes could be supported locally.  It is assumed that the
   interface will translate from the supplied string into
   PrintableString or T.61.

   The "+" notation is used to specify multi-component RDNs.  In this
   case, the types for attributes in the RDN must be explicit.  The name
   is presented/input in a little-endian order (most significant
   component last).

   When an address is written in a context where there is a need to
   delimit the entire address (e.g., in free text), it is recommended
   that the delimiters <> are used.  The terminator > is a special in
   the notation to facilitate this delimitation.

   <name> ::= <name-component> ( <spaced-separator> )
          | <name-component> <spaced-separator> <name>

   <spaced-separator> ::= <optional-space>
                   <separator>
                   <optional-space>

   <separator> ::=  "," | ";"

   <optional-space> ::= ( <CR> ) *( " " )

   <name-component> ::= <attribute>
           | <attribute> <optional-space> "+"
             <optional-space> <name-component>

   <attribute> ::= <string>
           | <key> <optional-space> "=" <optional-space> <string>

   <key> ::= 1*( <keychar> ) | "OID." <oid>
   <keychar> ::= letters, numbers, and space

   <oid> ::= <digitstring> | <digitstring> "." <oid>
   <digitstring> ::= 1*<digit>
   <digit> ::= digits 0-9

   <string> ::= *( <stringchar> | <pair> )
            | '"' *( <stringchar> | <special> | <pair> ) '"'
    | "#" <hex>

   <special> ::= "," | "=" | '"' | <CR> | "+" | "<" |  ">"
            | "#" | ";"

   <pair> ::= "
   <stringchar> ::= any char except <special> or "

   <hex> ::= 2*<hexchar>
   <hexchar> ::= 0-9, a-f, A-F

               Figure 1:  BNF Grammar for Distinguished Name

                        Key  Attribute (X.520 keys)
                        ______________________________
                        CN   CommonName
                        L    LocalityName
                        ST   StateOrProvinceName
                        O    OrganizationName
                        OU   OrganizationalUnitName
                        C    CountryName

                      Table 1:  Standardised Keywords

3.  Examples

   This section gives a few examples of distinguished names written
   using this notation:

      CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara,
      ST=California, C=US

      CN=FTAM Service, CN=Bells, OU=Computer Science, O=University
      College London, C=GB

      CN=Steve Hardcastle-Kille, OU=Computer Science, O=University
      College London, C=GB

      CN=Steve Hardcastle-Kille, OU=Computer Science, O=University
      College London, C=GB

4.  References

   [CCI88] The Directory --- overview of concepts, models and services,
           December 1988. CCITT X.500 Series Recommendations.

   [Cro82] D.H. Crocker. Standard of the format of ARPA internet text
           messages.  STD 11, RFC 822, University of Delaware,
           August 1982.

   [HK93]  S.E. Hardcastle-Kille. Using the OSI directory to achieve
           user friendly naming.  RFC 1484, Department of Computer
           Science, University College London, July 1993.

5.  Security Considerations

   Security issues are not discussed in this memo.

6.  Author's Address

   Steve Hardcastle-Kille
   ISODE Consortium
   P.O. Box 505
   London
   SW11 1DX
   England

   Phone:+44-71-223-4062
   EMail:  S.Kille@ISODE.COM

   DN: CN=Steve Hardcastle-Kille,
   O=ISODE Consortium, C=GB

   UFN: S. Hardcastle-Kille,
   ISODE Consortium, GB

AI ELI5

On this page
PROBLEMX.500 distinguished names are encoded in ASN.1, which is no use when a name must be written in a mail message or on a business card.
MECHANISMThe memo defines a string notation of comma or semicolon separated key=value components such as CN=..., OU=..., O=..., C=..., with quoting and a hexadecimal escape so that any distinguished name can be written.
STATUS TODAYThe RFC is Historic and was replaced by RFC 1779 and RFC 3494.

§1Why a Notation Is Needed

The OSI Directory, commonly known as X.500, uses distinguished names (DNs) as the primary keys to its entries. They are encoded in ASN.1, so people cannot easily pass them around. When a name has to travel between users who are not using a directory protocol, for example on a business card or in an email message, a string form that is user oriented is needed.

This notation targets general, user-oriented use, and in particular the names of humans. The memo notes that other syntaxes may suit other uses; the OSF syntax, which uses "/" as a separator and resembles UNIX filenames, may suit some system-oriented uses.

The computer's way of writing a name is a secret code. People need a version they can read out loud and write in a letter.

§2Goals and Informal Definition

The goals are an unambiguous representation, an intuitive format for most names, full generality (any distinguished name can be represented), flexibility of layout, and a clear view of what the name contains.

A name is written as components separated by a comma, with the least significant component first. For example CN=Christian Huitema, O=INRIA, C=FR. A semicolon may be used instead of a comma, and a name may be folded over several lines. In running text the whole name is delimited with < and >. A multi-valued Relative Distinguished Name is written with +, as in OU=Sales + CN=J. Smith, O=Widget Inc., C=US.

You write the person's name first, then their department, then their company, then their country, like an address that gets bigger and bigger.

§3Formal Definition, Quoting and Keywords

A BNF grammar based on the one in RFC 822 defines the format. It is written over an abstract character set. Quoting with double quotes is used for strings containing characters such as a comma, a plus sign, an equals sign, a quote mark, angle brackets, a hash sign or a semicolon, for strings with leading or trailing spaces, and for strings with consecutive spaces. An example is O="Sue, Grabbit and Runn".

For pathological cases there is an escape mechanism: attribute types may be written in dotted form (for example OID.2.6.53) and attribute values in hexadecimal (for example #0A56CF).

The grammar makes the attribute keyword optional, but this specification makes it mandatory. Implementations must support six keywords, and the IANA maintains a register of valid keywords. Only string-type attributes are considered, and the interface is assumed to translate the string into PrintableString or T.61. In a multi-component RDN the types must be explicit.

If a name has a comma in it, you put it inside quote marks so nobody thinks it is the end of a part. For very strange names there is a secret-code mode written in numbers.

KEYWORDS THAT MUST BE SUPPORTED (TABLE 1)
  • CNCommonName — The name of the entry itself.
  • LLocalityName — A place such as a town.
  • STStateOrProvinceName — A state or province.
  • OOrganizationName — The organisation.
  • OUOrganizationalUnitName — A unit inside an organisation.
  • CCountryName — The country.

§4Examples

The RFC lists several complete names. One is CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California, C=US. Another is CN=FTAM Service, CN=Bells, OU=Computer Science, O=University College London, C=GB, which shows a service entry deep in an organisation. The author's own entry appears as CN=Steve Hardcastle-Kille, OU=Computer Science, O=University College London, C=GB.

In its informal section the memo also shows a name where a locality is used, CN=James Hacker, L=Basingstoke, O=Widget Inc, CN=GB, to illustrate how different attribute types are handled.

The memo says security issues are not discussed. It also notes that RFC 1484 uses the same notation and relaxes some of its constraints for friendlier input; see RFC 1484.

It shows a handful of real-looking addresses so you can see the pattern: name, department, company, country.

§5References