RFC 1779

A String Representation of Distinguished Names

πŸ“… published March 1995, from ietf

A String Representation of Distinguished Names ✨

Okay bestie, let's talk about RFC 1779 πŸ¦‹ It's a Standards Track doc from March 1995, written by Steve Kille of the ISODE Consortium. It obsoletes RFC 1485, so 1485 is out and this one is the new hotness πŸ’… It's the Network Working Group's spec for writing Distinguished Names as strings 🌸


Status of this Memo

This doc specifies an Internet standards track protocol for the Internet community, and asks for discussion and suggestions for improvements πŸ’– Check the current edition of "Internet Official Protocol Standards" (STD 1) 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 ✨ They're encoded in ASN.1. When a distinguished name gets passed between two users who aren't using a directory protocol (like in a mail message), you need a user-oriented string representation 🫢 This spec defines a string format that gives a clean look for commonly used names, and it can still represent any distinguished name. Main character energy πŸ‘‘

Table of Contents

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

1. Why a notation is needed 🌈

Lots of OSI Applications use Distinguished Names (DN) as defined in the OSI Directory, which people usually call X.500 [1]. This spec assumes you already know X.500 and what a Distinguished Name is 🧚 It's important to have a common format so you can represent a distinguished name unambiguously. You might put a directory name on a business card or in an email, for example. We need a format for human-to-human communication, and it has to be string-based (not ASN.1) and user-oriented πŸ’… This notation is aimed at a general user-oriented system, especially for representing the names of humans. Other syntaxes might suit other uses of the directory better. For instance, the OSF Syntax may be a better fit for some system-oriented uses. (The OSF Syntax uses "/" as a separator, and forms names in a way meant to look like UNIX filenames πŸ™ˆ)

2. A notation for Distinguished Name πŸŽ€

2.1. Goals

Here are the goals, bestie πŸ“

  • To provide an unambiguous representation of a distinguished name
  • To be an intuitive format for the majority of names
  • To be fully general, and able to represent any distinguished name
  • To be amenable to a number of different layouts to achieve an attractive representation.
  • 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, and there are some examples to show the vibe ✨ The author's directory distinguished name would be written:

CN=Steve Kille,
O=ISODE Consortium, C=GB

It can be folded, maybe to display in multi-column format. For example:

CN=Steve Kille,
O=ISODE Consortium,
C=GB

Another name might be:

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

Semicolon (";") can be used as an alternate separator. You can mix the separators, but that's discouraged πŸ™ƒ

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

In running text, this would be written as <CN=Christian Huitema; O=INRIA; C=FR>. Here's another example, showing how different attribute types get handled πŸ’–

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

Here's an example of a multi-valued Relative Distinguished Name. The namespace is flat within an organisation, so department is used to tell certain names apart πŸ¦‹

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

The final examples show both ways of quoting a comma in an Organisation name 🌸

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

2.3. Formal definition

Now the formal definition, the serious part πŸ”₯ 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 <> [2]. The definition is written in an abstract character set, so it can be written in any character set that supports the explicitly defined special characters. The quoting mechanism gets used for these cases:

  • Strings containing ",", "+", "=" or """, <CR>, "<", ">", "#", or ";".
  • Strings with leading or trailing spaces
  • Strings containing consecutive spaces

There's an escape mechanism from the normal user-oriented form, so this syntax can print any valid distinguished name. Honestly it's ugly πŸ’€ It's expected to be used only in pathological cases. It has two parts:

  1. Attribute 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). Each pair of hex digits defines an octet, which is the ASN.1 Basic Encoding Rules value of the Attribute Value.

The keyword specification is optional in the BNF, but mandatory for this specification πŸŽ€ That way the same BNF can be used for the related specification on User Friendly Naming [5]. When this specification is followed, the attribute type keywords must always be present.

Here's the list of valid keywords for well-known attribute types used in naming (Table 1). Keywords may contain spaces, but shall not have leading or trailing spaces. This is a list of keywords which must be supported. They were chosen because they show up in common forms of name, and can do so in a spot that doesn't match the default schema used. A register of valid keywords is maintained by the IANA 🧚

<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> | "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> ::= "\" ( <special> | "\" | '"')
<stringchar> ::= any character except <special> or "\" 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
STREET  StreetAddress

Table 1: Standardised Keywords

Only string type attributes are considered, but other attribute syntaxes could be supported locally (e.g., by using the syntaxes defined in [3]). It's assumed that the interface will translate the supplied string into an appropriate Directory String encoding. The "+" notation is used to specify multi-component RDNs, and in that case the types for attributes in the RDN must be explicit πŸ’… The name is presented or input in little-endian order (most significant component last). When an address is written somewhere that needs to delimit the entire address (like free text), it is recommended that the delimiters <> are used. The terminator > is a special character in the notation to make that delimiting easy ✨

3. Examples πŸ¦‹

Here are a few examples of distinguished names written in 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=Markus Kuhn, O=University of Erlangen, C=DE

CN=Steve Kille,
O=ISODE Consortium,
C=GB
CN=Steve Kille ,

O =   ISODE Consortium,
C=GB

CN=Steve Kille, O=ISODE Consortium, C=GB

4. Acknowledgements 🫢

This work was based on research done at University College London [4], and evolved in the IETF OSI-DS WG 🌸

Input for this version of the document came from: Allan Cargille (University of Wisconsin); John Dale (COS); Philip Gladstone (Onsett); John Hawthorne (US Air Force); Roland Hedberg (University of Umea); Kipp Hickman (Mosaic Communications Corp.) Markus Kuhn (University of Erlangen); Elisabeth Roudier (E3X); Mark Wahl (ISODE Consortium). Love you all πŸ’œ

5. References πŸ“š

[1] The Directory --- overview of concepts, models and services, 1993. CCITT X.500 Series Recommendations.

[2] Crocker, D., "Standard of the Format of ARPA-Internet Text Messages", STD 11, RFC 822, University of Delaware, August 1982.

[3] Yeong, W., Howes, T., and S. Kille, "Lightweight Directory Access Protocol", RFC 1777, Performance Systems International, University of Michigan, ISODE Consortium, March 1995.

[4] S.E. Kille. Using the OSI directory to achieve user friendly naming. Research Note RN/20/29, Department of Computer Science, University College London, February 1990.

[5] Kille, S., "Using the OSI Directory to Achieve User Friendly Naming", RFC 1781, ISODE Consortium, March 1995.

6. Security Considerations πŸ’€

Security issues are not discussed in this memo. Seriously, this is the part where the spec says nothing, so be careful out there 😭

7. Author's Address 🧚

Steve Kille
ISODE Consortium
The Dome
The Square
Richmond, Surrey
TW9 1DT
England

Phone:  +44-181-332-9091
EMail:  S.Kille@ISODE.COM

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

UFN: S. Kille,
ISODE Consortium, GB

That's the whole RFC, bestie πŸŒˆπŸ’– Go forth and write those names properly πŸ’…βœ¨

πŸ“¦ where this page comes from