HP UX Red Hat Direry Server Software manual Representing Binary Data, Standard Ldif Notation

Models: UX Red Hat Direry Server Software

1 638
Download 638 pages 23.73 Kb
Page 561
Image 561

Representing Binary Data

In LDIF files, a line can be broken and continued (called folded) by indenting the continued portion of the line by exactly one space. For example, the following two statements are identical:

dn: cn=Jake Lupinski,dc=example,dc=com

dn: cn=Jake Lup

inski, dc=exa mple,dc=com

It is not required to break and continue LDIF lines. However, doing so may improve the readability of the LDIF file. The usual convention is that an LDIF file does not contain more than 78 columns of text.

3. Representing Binary Data

Binary data, such as a JPEG image, is represented in LDIF using one of two methods, standard LDIF notation or base-64 encoding.

3.1. Standard LDIF Notation

Standard LDIF notation uses the lesser than (<) symbol to indicate that the data are binary. For example:

jpegphoto: < file:/path/to/photo

With this standard notation, it is not necessary to specify the ldapmodify -bparameter. However, standard notation requires that the following line be added to the beginning of the LDIF file or the LDIF update statements:

version: 1

For example:

ldapmodify -DuserDN -wuser_password

version: 1

dn: cn=Barney Fife,ou=People,dc=example,dc=com

changetype: modify

add: userCertificate

userCertificate;binary: < file: BarneysCert

3.2. Base-64 Encoding

Binary data can be converted to base-64, which can be used in LDIF files, for a variety of data, from images to SSL certificates. Base 64-encoded data are identified by using the :: symbol.

541

Page 561
Image 561
HP UX Red Hat Direry Server Software manual Representing Binary Data, Standard Ldif Notation, Base-64 Encoding