Standard LDIF Notation
469
A.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 -b
parameter. 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 -D
userDN
-w
user_password
version: 1
dn: cn=Barney Fife,ou=People,dc=example,dc=com
changetype: modify
add: userCertificate
userCertificate;binary: < file: BarneysCert
A.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. 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
-b
parameter to convert binary data to LDIF format:
ldif -b
attribute_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
-b
option specifies that the
ldif
utility should interpret the entire input as a single binary value. If
-b
is not present, each line is considered to be a separate input value.
Содержание DIRECTORY SERVER 8.0
Страница 18: ...xviii ...
Страница 29: ...Configuring the Directory Manager 11 6 Enter the new password and confirm it 7 Click Save ...
Страница 30: ...12 ...
Страница 112: ...94 ...
Страница 128: ...110 ...
Страница 190: ...Chapter 6 Managing Access Control 172 4 Click New to open the Access Control Editor ...
Страница 224: ...206 ...
Страница 324: ...306 ...
Страница 334: ...316 ...
Страница 358: ...340 ...
Страница 410: ...392 ...
Страница 420: ...402 ...
Страница 444: ...426 ...
Страница 454: ...436 ...
Страница 464: ...446 ...
Страница 484: ...466 ...
Страница 512: ...494 ...
Страница 522: ...504 ...