@node danetool Invocation
@subsection Invoking danetool
@pindex danetool
@ignore
#  -*- buffer-read-only: t -*- vi: set ro:
#
# DO NOT EDIT THIS FILE   (invoke-danetool.texi)
#
# It has been AutoGen-ed
# From the definitions    ../src/danetool-args.def
# and the template file   agtexi-cmd.tpl
@end ignore


Tool to generate and check DNS resource records for the DANE protocol.

This section was generated by @strong{AutoGen},
using the @code{agtexi-cmd} template and the option descriptions for the @code{danetool} program.
This software is released under the GNU General Public License, version 3 or later.


@anchor{danetool usage}
@subsubheading danetool help/usage (@option{--help})
@cindex danetool help

This is the automatically generated usage text for danetool.

The text printed is the same whether selected with the @code{help} option
(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
the usage text by passing it through a pager program.
@code{more-help} is disabled on platforms without a working
@code{fork(2)} function.  The @code{PAGER} environment variable is
used to select the program, defaulting to @file{more}.  Both will exit
with a status code of 0.

@exampleindent 0
@example
danetool - GnuTLS DANE tool
Usage:  danetool [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...

   -d, --debug=num            Enable debugging
                                - it must be in the range:
                                  0 to 9999
   -V, --verbose              More verbose output
                                - may appear multiple times
       --infile=file          Input file
                                - file must pre-exist
       --outfile=str          Output file
       --load-pubkey=str      Loads a public key file
       --load-certificate=str Loads a certificate file
       --dlv=str              Sets a DLV file
       --hash=str             Hash algorithm to use for signing
       --check=str            Check a host's DANE TLSA entry
       --check-ee             Check only the end-entity's certificate
       --check-ca             Check only the CA's certificate
       --tlsa-rr              Print the DANE RR data on a certificate or public key
                                - requires the option 'host'
       --host=str             Specify the hostname to be used in the DANE RR
       --proto=str            The protocol set for DANE data (tcp, udp etc.)
       --port=str             The port or service to connect to, for DANE data
       --app-proto=str        an alias for the 'starttls-proto' option
       --starttls-proto=str   The application protocol to be used to obtain the server's certificate
(https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres)
       --ca                   Whether the provided certificate or public key is a Certificate
Authority
       --x509                 Use the hash of the X.509 certificate, rather than the public key
       --local                an alias for the 'domain' option
                                - enabled by default
       --domain               The provided certificate or public key is issued by the local domain
                                - disabled as '--no-domain'
                                - enabled by default
       --local-dns            Use the local DNS server for DNSSEC resolving
                                - disabled as '--no-local-dns'
       --insecure             Do not verify any DNSSEC signature
       --inder                Use DER format for input certificates and private keys
                                - disabled as '--no-inder'
       --inraw                an alias for the 'inder' option
       --print-raw            Print the received DANE data in raw format
                                - disabled as '--no-print-raw'
       --quiet                Suppress several informational messages
   -v, --version[=arg]        output version information and exit
   -h, --help                 display extended usage information and exit
   -!, --more-help            extended usage information passed thru pager

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.

Tool to generate and check DNS resource records for the DANE protocol.

@end example
@exampleindent 4

@anchor{danetool debug}
@subsubheading debug option (-d)

This is the ``enable debugging'' option.
This option takes a number argument.
Specifies the debug level.
@anchor{danetool load-pubkey}
@subsubheading load-pubkey option

This is the ``loads a public key file'' option.
This option takes a string argument.
This can be either a file or a PKCS #11 URL
@anchor{danetool load-certificate}
@subsubheading load-certificate option

This is the ``loads a certificate file'' option.
This option takes a string argument.
This can be either a file or a PKCS #11 URL
@anchor{danetool dlv}
@subsubheading dlv option

This is the ``sets a dlv file'' option.
This option takes a string argument.
This sets a DLV file to be used for DNSSEC verification.
@anchor{danetool hash}
@subsubheading hash option

This is the ``hash algorithm to use for signing'' option.
This option takes a string argument.
Available hash functions are SHA1, RMD160, SHA256, SHA384, SHA512.
@anchor{danetool check}
@subsubheading check option

This is the ``check a host's dane tlsa entry'' option.
This option takes a string argument.
Obtains the DANE TLSA entry from the given hostname and prints information. Note that the actual certificate of the host can be provided using --load-certificate, otherwise danetool will connect to the server to obtain it. The exit code on verification success will be zero.
@anchor{danetool check-ee}
@subsubheading check-ee option

This is the ``check only the end-entity's certificate'' option.
Checks the end-entity's certificate only. Trust anchors or CAs are not considered.
@anchor{danetool check-ca}
@subsubheading check-ca option

This is the ``check only the ca's certificate'' option.
Checks the trust anchor's and CA's certificate only. End-entities are not considered.
@anchor{danetool tlsa-rr}
@subsubheading tlsa-rr option

This is the ``print the dane rr data on a certificate or public key'' option.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
must appear in combination with the following options:
host.
@end itemize

This command prints the DANE RR data needed to enable DANE on a DNS server.
@anchor{danetool host}
@subsubheading host option

This is the ``specify the hostname to be used in the dane rr'' option.
This option takes a string argument @file{Hostname}.
This command sets the hostname for the DANE RR.
@anchor{danetool proto}
@subsubheading proto option

This is the ``the protocol set for dane data (tcp, udp etc.)'' option.
This option takes a string argument @file{Protocol}.
This command specifies the protocol for the service set in the DANE data.
@anchor{danetool app-proto}
@subsubheading app-proto option

This is an alias for the @code{starttls-proto} option,
@pxref{danetool starttls-proto, the starttls-proto option documentation}.

@anchor{danetool starttls-proto}
@subsubheading starttls-proto option

This is the ``the application protocol to be used to obtain the server's certificate (https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres)'' option.
This option takes a string argument.
When the server's certificate isn't provided danetool will connect to the server to obtain the certificate. In that case it is required to know the protocol to talk with the server prior to initiating the TLS handshake.
@anchor{danetool ca}
@subsubheading ca option

This is the ``whether the provided certificate or public key is a certificate authority'' option.
Marks the DANE RR as a CA certificate if specified.
@anchor{danetool x509}
@subsubheading x509 option

This is the ``use the hash of the x.509 certificate, rather than the public key'' option.
This option forces the generated record to contain the hash of the full X.509 certificate. By default only the hash of the public key is used.
@anchor{danetool local}
@subsubheading local option

This is an alias for the @code{domain} option,
@pxref{danetool domain, the domain option documentation}.

@anchor{danetool domain}
@subsubheading domain option

This is the ``the provided certificate or public key is issued by the local domain'' option.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
can be disabled with --no-domain.
@item
It is enabled by default.
@end itemize

DANE distinguishes certificates and public keys offered via the DNSSEC to trusted and local entities. This flag indicates that this is a domain-issued certificate, meaning that there could be no CA involved.
@anchor{danetool local-dns}
@subsubheading local-dns option

This is the ``use the local dns server for dnssec resolving'' option.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
can be disabled with --no-local-dns.
@end itemize

This option will use the local DNS server for DNSSEC.
This is disabled by default due to many servers not allowing DNSSEC.
@anchor{danetool insecure}
@subsubheading insecure option

This is the ``do not verify any dnssec signature'' option.
Ignores any DNSSEC signature verification results.
@anchor{danetool inder}
@subsubheading inder option

This is the ``use der format for input certificates and private keys'' option.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
can be disabled with --no-inder.
@end itemize

The input files will be assumed to be in DER or RAW format. 
Unlike options that in PEM input would allow multiple input data (e.g. multiple 
certificates), when reading in DER format a single data structure is read.
@anchor{danetool inraw}
@subsubheading inraw option

This is an alias for the @code{inder} option,
@pxref{danetool inder, the inder option documentation}.

@anchor{danetool print-raw}
@subsubheading print-raw option

This is the ``print the received dane data in raw format'' option.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
can be disabled with --no-print-raw.
@end itemize

This option will print the received DANE data.
@anchor{danetool quiet}
@subsubheading quiet option

This is the ``suppress several informational messages'' option.
In that case on the exit code can be used as an indication of verification success
@anchor{danetool exit status}
@subsubheading danetool exit status

One of the following exit values will be returned:
@table @samp
@item 0 (EXIT_SUCCESS)
Successful program execution.
@item 1 (EXIT_FAILURE)
The operation failed or the command syntax was not valid.
@end table
@anchor{danetool See Also}
@subsubheading danetool See Also
    certtool (1)
@anchor{danetool Examples}
@subsubheading danetool Examples
@subsubheading DANE TLSA RR generation

To create a DANE TLSA resource record for a certificate (or public key) 
that was issued localy and may or may not be signed by a CA use the following command.
@example
$ danetool --tlsa-rr --host www.example.com --load-certificate cert.pem
@end example

To create a DANE TLSA resource record for a CA signed certificate, which will
be marked as such use the following command.
@example
$ danetool --tlsa-rr --host www.example.com --load-certificate cert.pem \
  --no-domain
@end example

The former is useful to add in your DNS entry even if your certificate is signed 
by a CA. That way even users who do not trust your CA will be able to verify your
certificate using DANE.

In order to create a record for the CA signer of your certificate use the following.
@example
$ danetool --tlsa-rr --host www.example.com --load-certificate cert.pem \
  --ca --no-domain
@end example

To read a server's DANE TLSA entry, use:
@example
$ danetool --check www.example.com --proto tcp --port 443
@end example

To verify an HTTPS server's DANE TLSA entry, use:
@example
$ danetool --check www.example.com --proto tcp --port 443 --load-certificate chain.pem
@end example

To verify an SMTP server's DANE TLSA entry, use:
@example
$ danetool --check www.example.com --proto tcp --starttls-proto=smtp --load-certificate chain.pem
@end example
