Blame doc/invoke-danetool.texi

Packit aea12f
@node danetool Invocation
Packit aea12f
@subsection Invoking danetool
Packit aea12f
@pindex danetool
Packit aea12f
@ignore
Packit aea12f
#  -*- buffer-read-only: t -*- vi: set ro:
Packit aea12f
#
Packit aea12f
# DO NOT EDIT THIS FILE   (invoke-danetool.texi)
Packit aea12f
#
Packit aea12f
# It has been AutoGen-ed
Packit aea12f
# From the definitions    ../src/danetool-args.def
Packit aea12f
# and the template file   agtexi-cmd.tpl
Packit aea12f
@end ignore
Packit aea12f
Packit aea12f
Packit aea12f
Tool to generate and check DNS resource records for the DANE protocol.
Packit aea12f
Packit aea12f
This section was generated by @strong{AutoGen},
Packit aea12f
using the @code{agtexi-cmd} template and the option descriptions for the @code{danetool} program.
Packit aea12f
This software is released under the GNU General Public License, version 3 or later.
Packit aea12f
Packit aea12f
Packit aea12f
@anchor{danetool usage}
Packit aea12f
@subsubheading danetool help/usage (@option{--help})
Packit aea12f
@cindex danetool help
Packit aea12f
Packit aea12f
This is the automatically generated usage text for danetool.
Packit aea12f
Packit aea12f
The text printed is the same whether selected with the @code{help} option
Packit aea12f
(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
Packit aea12f
the usage text by passing it through a pager program.
Packit aea12f
@code{more-help} is disabled on platforms without a working
Packit aea12f
@code{fork(2)} function.  The @code{PAGER} environment variable is
Packit aea12f
used to select the program, defaulting to @file{more}.  Both will exit
Packit aea12f
with a status code of 0.
Packit aea12f
Packit aea12f
@exampleindent 0
Packit aea12f
@example
Packit aea12f
danetool - GnuTLS DANE tool
Packit aea12f
Usage:  danetool [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
Packit aea12f
Packit aea12f
   -d, --debug=num            Enable debugging
Packit aea12f
                                - it must be in the range:
Packit aea12f
                                  0 to 9999
Packit aea12f
   -V, --verbose              More verbose output
Packit aea12f
                                - may appear multiple times
Packit aea12f
       --infile=file          Input file
Packit aea12f
                                - file must pre-exist
Packit aea12f
       --outfile=str          Output file
Packit aea12f
       --load-pubkey=str      Loads a public key file
Packit aea12f
       --load-certificate=str Loads a certificate file
Packit aea12f
       --dlv=str              Sets a DLV file
Packit aea12f
       --hash=str             Hash algorithm to use for signing
Packit aea12f
       --check=str            Check a host's DANE TLSA entry
Packit aea12f
       --check-ee             Check only the end-entity's certificate
Packit aea12f
       --check-ca             Check only the CA's certificate
Packit aea12f
       --tlsa-rr              Print the DANE RR data on a certificate or public key
Packit aea12f
                                - requires the option 'host'
Packit aea12f
       --host=str             Specify the hostname to be used in the DANE RR
Packit aea12f
       --proto=str            The protocol set for DANE data (tcp, udp etc.)
Packit aea12f
       --port=str             The port or service to connect to, for DANE data
Packit aea12f
       --app-proto=str        an alias for the 'starttls-proto' option
Packit aea12f
       --starttls-proto=str   The application protocol to be used to obtain the server's certificate
Packit aea12f
(https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres)
Packit aea12f
       --ca                   Whether the provided certificate or public key is a Certificate
Packit aea12f
Authority
Packit aea12f
       --x509                 Use the hash of the X.509 certificate, rather than the public key
Packit aea12f
       --local                an alias for the 'domain' option
Packit aea12f
                                - enabled by default
Packit aea12f
       --domain               The provided certificate or public key is issued by the local domain
Packit aea12f
                                - disabled as '--no-domain'
Packit aea12f
                                - enabled by default
Packit aea12f
       --local-dns            Use the local DNS server for DNSSEC resolving
Packit aea12f
                                - disabled as '--no-local-dns'
Packit aea12f
       --insecure             Do not verify any DNSSEC signature
Packit aea12f
       --inder                Use DER format for input certificates and private keys
Packit aea12f
                                - disabled as '--no-inder'
Packit aea12f
       --inraw                an alias for the 'inder' option
Packit aea12f
       --print-raw            Print the received DANE data in raw format
Packit aea12f
                                - disabled as '--no-print-raw'
Packit aea12f
       --quiet                Suppress several informational messages
Packit aea12f
   -v, --version[=arg]        output version information and exit
Packit aea12f
   -h, --help                 display extended usage information and exit
Packit aea12f
   -!, --more-help            extended usage information passed thru pager
Packit aea12f
Packit aea12f
Options are specified by doubled hyphens and their name or by a single
Packit aea12f
hyphen and the flag character.
Packit aea12f
Packit aea12f
Tool to generate and check DNS resource records for the DANE protocol.
Packit aea12f
Packit aea12f
@end example
Packit aea12f
@exampleindent 4
Packit aea12f
Packit aea12f
@anchor{danetool debug}
Packit aea12f
@subsubheading debug option (-d)
Packit aea12f
Packit aea12f
This is the ``enable debugging'' option.
Packit aea12f
This option takes a number argument.
Packit aea12f
Specifies the debug level.
Packit aea12f
@anchor{danetool load-pubkey}
Packit aea12f
@subsubheading load-pubkey option
Packit aea12f
Packit aea12f
This is the ``loads a public key file'' option.
Packit aea12f
This option takes a string argument.
Packit aea12f
This can be either a file or a PKCS #11 URL
Packit aea12f
@anchor{danetool load-certificate}
Packit aea12f
@subsubheading load-certificate option
Packit aea12f
Packit aea12f
This is the ``loads a certificate file'' option.
Packit aea12f
This option takes a string argument.
Packit aea12f
This can be either a file or a PKCS #11 URL
Packit aea12f
@anchor{danetool dlv}
Packit aea12f
@subsubheading dlv option
Packit aea12f
Packit aea12f
This is the ``sets a dlv file'' option.
Packit aea12f
This option takes a string argument.
Packit aea12f
This sets a DLV file to be used for DNSSEC verification.
Packit aea12f
@anchor{danetool hash}
Packit aea12f
@subsubheading hash option
Packit aea12f
Packit aea12f
This is the ``hash algorithm to use for signing'' option.
Packit aea12f
This option takes a string argument.
Packit aea12f
Available hash functions are SHA1, RMD160, SHA256, SHA384, SHA512.
Packit aea12f
@anchor{danetool check}
Packit aea12f
@subsubheading check option
Packit aea12f
Packit aea12f
This is the ``check a host's dane tlsa entry'' option.
Packit aea12f
This option takes a string argument.
Packit aea12f
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.
Packit aea12f
@anchor{danetool check-ee}
Packit aea12f
@subsubheading check-ee option
Packit aea12f
Packit aea12f
This is the ``check only the end-entity's certificate'' option.
Packit aea12f
Checks the end-entity's certificate only. Trust anchors or CAs are not considered.
Packit aea12f
@anchor{danetool check-ca}
Packit aea12f
@subsubheading check-ca option
Packit aea12f
Packit aea12f
This is the ``check only the ca's certificate'' option.
Packit aea12f
Checks the trust anchor's and CA's certificate only. End-entities are not considered.
Packit aea12f
@anchor{danetool tlsa-rr}
Packit aea12f
@subsubheading tlsa-rr option
Packit aea12f
Packit aea12f
This is the ``print the dane rr data on a certificate or public key'' option.
Packit aea12f
Packit aea12f
@noindent
Packit aea12f
This option has some usage constraints.  It:
Packit aea12f
@itemize @bullet
Packit aea12f
@item
Packit aea12f
must appear in combination with the following options:
Packit aea12f
host.
Packit aea12f
@end itemize
Packit aea12f
Packit aea12f
This command prints the DANE RR data needed to enable DANE on a DNS server.
Packit aea12f
@anchor{danetool host}
Packit aea12f
@subsubheading host option
Packit aea12f
Packit aea12f
This is the ``specify the hostname to be used in the dane rr'' option.
Packit aea12f
This option takes a string argument @file{Hostname}.
Packit aea12f
This command sets the hostname for the DANE RR.
Packit aea12f
@anchor{danetool proto}
Packit aea12f
@subsubheading proto option
Packit aea12f
Packit aea12f
This is the ``the protocol set for dane data (tcp, udp etc.)'' option.
Packit aea12f
This option takes a string argument @file{Protocol}.
Packit aea12f
This command specifies the protocol for the service set in the DANE data.
Packit aea12f
@anchor{danetool app-proto}
Packit aea12f
@subsubheading app-proto option
Packit aea12f
Packit aea12f
This is an alias for the @code{starttls-proto} option,
Packit aea12f
@pxref{danetool starttls-proto, the starttls-proto option documentation}.
Packit aea12f
Packit aea12f
@anchor{danetool starttls-proto}
Packit aea12f
@subsubheading starttls-proto option
Packit aea12f
Packit aea12f
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.
Packit aea12f
This option takes a string argument.
Packit aea12f
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.
Packit aea12f
@anchor{danetool ca}
Packit aea12f
@subsubheading ca option
Packit aea12f
Packit aea12f
This is the ``whether the provided certificate or public key is a certificate authority'' option.
Packit aea12f
Marks the DANE RR as a CA certificate if specified.
Packit aea12f
@anchor{danetool x509}
Packit aea12f
@subsubheading x509 option
Packit aea12f
Packit aea12f
This is the ``use the hash of the x.509 certificate, rather than the public key'' option.
Packit aea12f
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.
Packit aea12f
@anchor{danetool local}
Packit aea12f
@subsubheading local option
Packit aea12f
Packit aea12f
This is an alias for the @code{domain} option,
Packit aea12f
@pxref{danetool domain, the domain option documentation}.
Packit aea12f
Packit aea12f
@anchor{danetool domain}
Packit aea12f
@subsubheading domain option
Packit aea12f
Packit aea12f
This is the ``the provided certificate or public key is issued by the local domain'' option.
Packit aea12f
Packit aea12f
@noindent
Packit aea12f
This option has some usage constraints.  It:
Packit aea12f
@itemize @bullet
Packit aea12f
@item
Packit aea12f
can be disabled with --no-domain.
Packit aea12f
@item
Packit aea12f
It is enabled by default.
Packit aea12f
@end itemize
Packit aea12f
Packit aea12f
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.
Packit aea12f
@anchor{danetool local-dns}
Packit aea12f
@subsubheading local-dns option
Packit aea12f
Packit aea12f
This is the ``use the local dns server for dnssec resolving'' option.
Packit aea12f
Packit aea12f
@noindent
Packit aea12f
This option has some usage constraints.  It:
Packit aea12f
@itemize @bullet
Packit aea12f
@item
Packit aea12f
can be disabled with --no-local-dns.
Packit aea12f
@end itemize
Packit aea12f
Packit aea12f
This option will use the local DNS server for DNSSEC.
Packit aea12f
This is disabled by default due to many servers not allowing DNSSEC.
Packit aea12f
@anchor{danetool insecure}
Packit aea12f
@subsubheading insecure option
Packit aea12f
Packit aea12f
This is the ``do not verify any dnssec signature'' option.
Packit aea12f
Ignores any DNSSEC signature verification results.
Packit aea12f
@anchor{danetool inder}
Packit aea12f
@subsubheading inder option
Packit aea12f
Packit aea12f
This is the ``use der format for input certificates and private keys'' option.
Packit aea12f
Packit aea12f
@noindent
Packit aea12f
This option has some usage constraints.  It:
Packit aea12f
@itemize @bullet
Packit aea12f
@item
Packit aea12f
can be disabled with --no-inder.
Packit aea12f
@end itemize
Packit aea12f
Packit aea12f
The input files will be assumed to be in DER or RAW format. 
Packit aea12f
Unlike options that in PEM input would allow multiple input data (e.g. multiple 
Packit aea12f
certificates), when reading in DER format a single data structure is read.
Packit aea12f
@anchor{danetool inraw}
Packit aea12f
@subsubheading inraw option
Packit aea12f
Packit aea12f
This is an alias for the @code{inder} option,
Packit aea12f
@pxref{danetool inder, the inder option documentation}.
Packit aea12f
Packit aea12f
@anchor{danetool print-raw}
Packit aea12f
@subsubheading print-raw option
Packit aea12f
Packit aea12f
This is the ``print the received dane data in raw format'' option.
Packit aea12f
Packit aea12f
@noindent
Packit aea12f
This option has some usage constraints.  It:
Packit aea12f
@itemize @bullet
Packit aea12f
@item
Packit aea12f
can be disabled with --no-print-raw.
Packit aea12f
@end itemize
Packit aea12f
Packit aea12f
This option will print the received DANE data.
Packit aea12f
@anchor{danetool quiet}
Packit aea12f
@subsubheading quiet option
Packit aea12f
Packit aea12f
This is the ``suppress several informational messages'' option.
Packit aea12f
In that case on the exit code can be used as an indication of verification success
Packit aea12f
@anchor{danetool exit status}
Packit aea12f
@subsubheading danetool exit status
Packit aea12f
Packit aea12f
One of the following exit values will be returned:
Packit aea12f
@table @samp
Packit aea12f
@item 0 (EXIT_SUCCESS)
Packit aea12f
Successful program execution.
Packit aea12f
@item 1 (EXIT_FAILURE)
Packit aea12f
The operation failed or the command syntax was not valid.
Packit aea12f
@end table
Packit aea12f
@anchor{danetool See Also}
Packit aea12f
@subsubheading danetool See Also
Packit aea12f
    certtool (1)
Packit aea12f
@anchor{danetool Examples}
Packit aea12f
@subsubheading danetool Examples
Packit aea12f
@subsubheading DANE TLSA RR generation
Packit aea12f
Packit aea12f
To create a DANE TLSA resource record for a certificate (or public key) 
Packit aea12f
that was issued localy and may or may not be signed by a CA use the following command.
Packit aea12f
@example
Packit aea12f
$ danetool --tlsa-rr --host www.example.com --load-certificate cert.pem
Packit aea12f
@end example
Packit aea12f
Packit aea12f
To create a DANE TLSA resource record for a CA signed certificate, which will
Packit aea12f
be marked as such use the following command.
Packit aea12f
@example
Packit aea12f
$ danetool --tlsa-rr --host www.example.com --load-certificate cert.pem \
Packit aea12f
  --no-domain
Packit aea12f
@end example
Packit aea12f
Packit aea12f
The former is useful to add in your DNS entry even if your certificate is signed 
Packit aea12f
by a CA. That way even users who do not trust your CA will be able to verify your
Packit aea12f
certificate using DANE.
Packit aea12f
Packit aea12f
In order to create a record for the CA signer of your certificate use the following.
Packit aea12f
@example
Packit aea12f
$ danetool --tlsa-rr --host www.example.com --load-certificate cert.pem \
Packit aea12f
  --ca --no-domain
Packit aea12f
@end example
Packit aea12f
Packit aea12f
To read a server's DANE TLSA entry, use:
Packit aea12f
@example
Packit aea12f
$ danetool --check www.example.com --proto tcp --port 443
Packit aea12f
@end example
Packit aea12f
Packit aea12f
To verify an HTTPS server's DANE TLSA entry, use:
Packit aea12f
@example
Packit aea12f
$ danetool --check www.example.com --proto tcp --port 443 --load-certificate chain.pem
Packit aea12f
@end example
Packit aea12f
Packit aea12f
To verify an SMTP server's DANE TLSA entry, use:
Packit aea12f
@example
Packit aea12f
$ danetool --check www.example.com --proto tcp --starttls-proto=smtp --load-certificate chain.pem
Packit aea12f
@end example