Appendix A. LDAP Data Interchange Format

For example:

jpegPhoto::encoded_data

In addition to binary data, other values that must be base-64 encoded include the following:

Any value that begins with a colon (:) or a space.

Any value that contains non-ASCII data, including new lines.

Use the ldif command-line utility with the -bparameter to convert binary data to LDIF format:

ldif -battribute_name

attribute_name is the name of the attribute to which the binary data is supplied. The binary data is read from standard input and the results are written to standard output. Thus, use redirection operators to select input and output files.

The ldif command-line utility will take any input and format it with the correct line continuation and appropriate attribute information. The ldif utility also assesses whether the input requires base-64 encoding. For example:

ldif -b jpegPhoto < mark.jpg > out.ldif

This example takes a binary file containing a JPEG-formatted image and converts it into LDIF format for the attribute jpegPhoto. The output is saved to out.ldif.

The -boption specifies that the ldif utility should interpret the entire input as a single binary value. If -bis not present, each line is considered to be a separate input value.

4. Specifying Directory Entries Using LDIF

Many types of entries can be stored in the directory. This section concentrates on three of the most common types of entries used in a directory: domain, organizational unit, and organizational person entries.

The object classes defined for an entry are what indicate whether the entry represents a domain or domain component, an organizational unit, an organizational person, or some other type of entry.

4.1. Specifying Domain Entries

Directories often have at least one domain entry. Typically this is the first, or topmost, entry in the directory. The domain entry often corresponds to the DNS host and domain name for your directory. For example, if the Directory Server host is called ldap.example.com, then the

542

Page 562
Image 562
HP UX Red Hat Direry Server Software manual Specifying Directory Entries Using Ldif, Specifying Domain Entries