The validate-ldif Command-Line Tool
Validate the contents of an LDIF file against the server schema.
Usage
validate-ldif {arguments}
LDAP Connection and Authentication Arguments
-
-h {host} / --hostname {host} — The IP address or resolvable name to use to connect to the directory server. If this is not provided, then a default value of 'localhost' will be used.
-
-p {port} / --port {port} — The port to use to connect to the directory server. If this is not provided, then a default value of 389 will be used.
The specified value must not be less than 1 or greater than 65,535.
-
-D {dn} / --bindDN {dn} — The DN to use to bind to the directory server when performing simple authentication.
A provided value must be able to be parsed as an LDAP distinguished name as described in RFC 4514.
-
-w {password} / --bindPassword {password} — The password to use to bind to the directory server when performing simple authentication or a password-based SASL mechanism.
-
-j {path} / --bindPasswordFile {path} — The path to the file containing the password to use to bind to the directory server when performing simple authentication or a password-based SASL mechanism.
The specified path must refer to a file that exists.
-
--promptForBindPassword — Indicates that the tool should interactively prompt the user for the bind password.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
-Z / --useSSL — Use SSL when communicating with the directory server.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
-q / --useStartTLS — Use StartTLS when communicating with the directory server.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--defaultTrust — Use the JVM's default trust store, and optionally an additional trust store specified using the --trustStorePath argument, to non-interactively determine whether to trust any certificate chain presented during TLS negotiation. If the chain cannot be trusted based on any of those sources, then negotiation will fail without prompting about whether to trust it.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
-X / --trustAll — Trust any certificate presented by the directory server.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
-K {path} / --keyStorePath {path} — The path to the file to use as the key store for obtaining client certificates when communicating securely with the directory server.
-
-W {password} / --keyStorePassword {password} — The password to use to access the key store contents.
-
-u {path} / --keyStorePasswordFile {path} — The path to the file containing the password to use to access the key store contents.
The specified path must refer to a file that may or may not exist.
-
--promptForKeyStorePassword — Indicates that the tool should interactively prompt the user for the password to use to access the key store contents.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--keyStoreFormat {format} — The format (e.g., JKS, PKCS12, PKCS11, BCFKS, etc.) for the key store file.
-
-P {path} / --trustStorePath {path} — The path to the file to use as trust store when determining whether to trust a certificate presented by the directory server.
-
-T {password} / --trustStorePassword {password} — The password to use to access the trust store contents.
-
-U {path} / --trustStorePasswordFile {path} — The path to the file containing the password to use to access the trust store contents.
The specified path must refer to a file that may or may not exist.
-
--promptForTrustStorePassword — Indicates that the tool should interactively prompt the user for the password to use to access the trust store contents.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--trustStoreFormat {format} — The format (e.g., JKS, PKCS12, PKCS11, BCFKS, etc.) for the trust store file.
-
--verifyCertificateHostnames — Indicates that the tool should verify that the hostname or IP addressed used to establish connections ot the LDAP server matches an address for which the server's TLS certificate was issued.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
-N {nickname} / --certNickname {nickname} — The nickname (alias) of the client certificate in the key store to present to the directory server for SSL client authentication.
-
--enableSSLDebugging — Enable Java's low-level support for debugging SSL/TLS communication. This is equivalent to setting the 'javax.net.debug' property to 'all'.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
-o {name=value} / --saslOption {name=value} — A name-value pair providing information to use when performing SASL authentication.
-
--useSASLExternal — Use the SASL EXTERNAL mechanism to authenticate.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--helpSASL — Provide information about the supported SASL mechanisms, including the properties available for use with each.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
Validation Strictness Arguments
-
--ignoreDuplicateValues — Ignore validation failures due to entries containing duplicate values for the same attribute.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreUndefinedObjectClasses — Ignore validation failures due to object classes not defined in the schema.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreUndefinedAttributes — Ignore validation failures due to attributes not defined in the schema.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreMalformedDNs — Ignore validation failures due to entries with malformed DNs.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreMissingRDNValues — Ignore validation failures due to entries with RDN attribute values that are missing from the set of entry attributes.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreStructuralObjectClasses — Ignore validation failures due to entries without exactly structural object class.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreProhibitedObjectClasses — Ignore validation failures due to entries with object classes that are not allowed.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreMissingSuperiorObjectClasses — Ignore validation failures due to entries that are one or more superior object classes.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreProhibitedAttributes — Ignore validation failures due to entries with attributes that are not allowed.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreMissingAttributes — Ignore validation failures due to entries missing required attributes.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreSingleValuedAttributes — Ignore validation failures due to entries with multiple values for single-valued attributes.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreAttributeSyntax — Ignore validation failures due to entries with attribute values that violate their associated syntax. If this is provided, then no attribute syntax violations will be flagged. If this is not provided, then all attribute syntax violations will be flagged except for violations in those attributes excluded by the --ignoreSyntaxViolationsForAttribute argument.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--ignoreSyntaxViolationsForAttribute {attr} — The name or OID of an attribute for which to ignore validation failures due to violations of the associated attribute syntax. This argument can only be used if the --ignoreAttributeSyntax argument is not provided.
-
--ignoreNameForms — Ignore validation failures due to entries with RDNs that violate the associated name form definition.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
Additional Arguments
-
-f {path} / --ldifFile {path} — The path to the LDIF file to process. The tool will automatically attempt to detect whether the file is encrypted or compressed.
The specified path must refer to a file that exists.
-
-c / --isCompressed — Indicates that the specified LDIF file is compressed using gzip compression.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--encryptionPassphraseFile {path} — Indicates that the specified LDIF file is encrypted and that the encryption passphrase is contained in the specified file. If the LDIF data is encrypted and this argument is not provided, then the tool will interactively prompt for the encryption passphrase.
The specified path must refer to a file that exists.
-
-R {path} / --rejectFile {path} — The path to the file to which rejected entries should be written.
The specified path must refer to a file which may or may not exist, but whose parent directory must exist.
-
--schemaDirectory {path} — The path to a directory containing one or more LDIF files with the schema information to use. If this is provided, then no LDAP communication will be performed.
The specified path must refer to a directory that exists.
-
-t {num} / --numThreads {num} — The number of threads to use when processing the LDIF file.
The specified value must not be less than 1 or greater than 2,147,483,647.
-
--interactive — Launch the tool in interactive mode.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--outputFile {path} — Write all standard output and standard error messages to the specified file instead of to the console.
The specified path must refer to a file which may or may not exist, but whose parent directory must exist.
-
--appendToOutputFile — Indicates that the tool should append to the file specified by the --outputFile argument if it already exists. If this argument is not provided and the output file already exists, it will be overwritten.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--teeOutput — Write all standard output and standard error messages to the console as well as to the specified output file. The --outputFile argument must also be provided.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
-H / --help — Display usage information for this program.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--help-debug — Display usage information for debug logging.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--enable-debug-logging — Enables debug logging for the tool.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--debug-log-level {level} — The debug log level to use for the tool. Allowed values include 'off', 'severe', 'warning', 'info', 'fine', 'finer', and 'finest'. If this is not specified, a default level of 'severe' will be used.
-
--debug-log-category {category} — The message categories to include in the debug log output. Allowed values include 'asn1', 'connect', 'exception', 'ldap', 'connectionpool', 'ldif', 'monitor', 'codingerror', and 'other'. This argument may be provided multiple times to indicate that multiple categories should be included. If this is not specified, then all categories will be included.
-
--include-debug-stack-traces — Indicates that debug log messages should include a stack trace with the code location from which each debug message originated.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--use-multi-line-debug-messages — Indicates that debug log messages (which will be JSON objects) should be written as multi-line strings rather than single-line strings.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--debug-log-file {path} — The path to the debug log file to be written. If this is not specified, a default path of 'validate-ldif.debug' will be used.
The specified path must refer to a file which may or may not exist, but whose parent directory must exist.
-
-V / --version — Display version information for this program.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--propertiesFilePath {path} — The path to a properties file used to specify default values for arguments not supplied on the command line.
The specified path must refer to a file that exists.
-
--generatePropertiesFile {path} — Write an empty properties file that may be used to specify default values for arguments.
The specified path must refer to a file which may or may not exist, but whose parent directory must exist.
-
--noPropertiesFile — Do not obtain any argument values from a properties file.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
-
--suppressPropertiesFileComment — Suppress output listing the arguments obtained from a properties file.
This argument is not allowed to have a value. If this argument is included in a set of arguments, then it will be assumed to have a value of 'true'. If it is absent from a set of arguments, then it will be assumed to have a value of 'false'.
Dependent Argument Sets
-
If the --keyStorePassword argument is provided, then the --keyStorePath argument must also be provided.
-
If the --keyStorePasswordFile argument is provided, then the --keyStorePath argument must also be provided.
-
If the --promptForKeyStorePassword argument is provided, then the --keyStorePath argument must also be provided.
-
If the --trustStorePassword argument is provided, then the --trustStorePath argument must also be provided.
-
If the --trustStorePasswordFile argument is provided, then the --trustStorePath argument must also be provided.
-
If the --promptForTrustStorePassword argument is provided, then the --trustStorePath argument must also be provided.
-
If the --keyStorePath argument is provided, then at least one of the following arguments must also be provided: --useSSL, --useStartTLS
-
If the --trustStorePath argument is provided, then at least one of the following arguments must also be provided: --useSSL, --useStartTLS
-
If the --defaultTrust argument is provided, then at least one of the following arguments must also be provided: --useSSL, --useStartTLS
-
If the --trustAll argument is provided, then at least one of the following arguments must also be provided: --useSSL, --useStartTLS
-
If the --bindPassword argument is provided, then at least one of the following arguments must also be provided: --bindDN, --saslOption
-
If the --bindPasswordFile argument is provided, then at least one of the following arguments must also be provided: --bindDN, --saslOption
-
If the --promptForBindPassword argument is provided, then at least one of the following arguments must also be provided: --bindDN, --saslOption
-
If the --appendToOutputFile argument is provided, then the --outputFile argument must also be provided.
-
If the --teeOutput argument is provided, then the --outputFile argument must also be provided.
Exclusive Argument Sets
-
The following arguments cannot be used together: --useSSL, --useStartTLS
-
The following arguments cannot be used together: --keyStorePassword, --keyStorePasswordFile, --promptForKeyStorePassword
-
The following arguments cannot be used together: --trustStorePassword, --trustStorePasswordFile, --promptForTrustStorePassword
-
The following arguments cannot be used together: --defaultTrust, --trustAll
-
The following arguments cannot be used together: --trustAll, --trustStorePath
-
The following arguments cannot be used together: --bindDN, --saslOption, --useSASLExternal
-
The following arguments cannot be used together: --bindPassword, --bindPasswordFile, --promptForBindPassword
-
The following arguments cannot be used together: --ignoreAttributeSyntax, --ignoreSyntaxViolationsForAttribute
-
The following arguments cannot be used together: --propertiesFilePath, --noPropertiesFile
Examples
- Validate the contents of the 'data.ldif' file using the schema defined in the specified directory server using four concurrent threads. All types of validation will be performed, and information about any errors will be written to the 'rejects.ldif' file.
validate-ldif --hostname server.example.com --port 389 \
--ldifFile data.ldif --rejectFile rejects.ldif --numThreads 4
- Validate the contents of the 'data.ldif' file using the schema defined in LDIF files contained in the /ds/config/schema directory using a single thread. Any errors resulting from entries that do not have exactly one structural object class or from values which violate the syntax for their associated attribute types will be ignored. Information about any other failures will be written to the 'rejects.ldif' file.
validate-ldif --schemaDirectory /ds/config/schema --ldifFile data.ldif \
--rejectFile rejects.ldif --ignoreStructuralObjectClasses \
--ignoreAttributeSyntax