]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - contrib/bind9/bin/dnssec/dnssec-keygen.docbook
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / contrib / bind9 / bin / dnssec / dnssec-keygen.docbook
1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3                [<!ENTITY mdash "&#8212;">]>
4 <!--
5  - Copyright (C) 2004, 2005, 2007-2010  Internet Systems Consortium, Inc. ("ISC")
6  - Copyright (C) 2000-2003  Internet Software Consortium.
7  -
8  - Permission to use, copy, modify, and/or distribute this software for any
9  - purpose with or without fee is hereby granted, provided that the above
10  - copyright notice and this permission notice appear in all copies.
11  -
12  - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
13  - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14  - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15  - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16  - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
17  - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18  - PERFORMANCE OF THIS SOFTWARE.
19 -->
20
21 <!-- $Id: dnssec-keygen.docbook,v 1.22.44.4 2010/01/15 23:47:33 tbox Exp $ -->
22 <refentry id="man.dnssec-keygen">
23   <refentryinfo>
24     <date>June 30, 2000</date>
25   </refentryinfo>
26
27   <refmeta>
28     <refentrytitle><application>dnssec-keygen</application></refentrytitle>
29     <manvolnum>8</manvolnum>
30     <refmiscinfo>BIND9</refmiscinfo>
31   </refmeta>
32
33   <refnamediv>
34     <refname><application>dnssec-keygen</application></refname>
35     <refpurpose>DNSSEC key generation tool</refpurpose>
36   </refnamediv>
37
38   <docinfo>
39     <copyright>
40       <year>2004</year>
41       <year>2005</year>
42       <year>2007</year>
43       <year>2008</year>
44       <year>2009</year>
45       <year>2010</year>
46       <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
47     </copyright>
48     <copyright>
49       <year>2000</year>
50       <year>2001</year>
51       <year>2002</year>
52       <year>2003</year>
53       <holder>Internet Software Consortium.</holder>
54     </copyright>
55   </docinfo>
56
57   <refsynopsisdiv>
58     <cmdsynopsis>
59       <command>dnssec-keygen</command>
60       <arg choice="req">-a <replaceable class="parameter">algorithm</replaceable></arg>
61       <arg choice="req">-b <replaceable class="parameter">keysize</replaceable></arg>
62       <arg choice="req">-n <replaceable class="parameter">nametype</replaceable></arg>
63       <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
64       <arg><option>-e</option></arg>
65       <arg><option>-f <replaceable class="parameter">flag</replaceable></option></arg>
66       <arg><option>-g <replaceable class="parameter">generator</replaceable></option></arg>
67       <arg><option>-h</option></arg>
68       <arg><option>-k</option></arg>
69       <arg><option>-p <replaceable class="parameter">protocol</replaceable></option></arg>
70       <arg><option>-r <replaceable class="parameter">randomdev</replaceable></option></arg>
71       <arg><option>-s <replaceable class="parameter">strength</replaceable></option></arg>
72       <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
73       <arg><option>-v <replaceable class="parameter">level</replaceable></option></arg>
74       <arg choice="req">name</arg>
75     </cmdsynopsis>
76   </refsynopsisdiv>
77
78   <refsect1>
79     <title>DESCRIPTION</title>
80     <para><command>dnssec-keygen</command>
81       generates keys for DNSSEC (Secure DNS), as defined in RFC 2535
82       and RFC 4034.  It can also generate keys for use with
83       TSIG (Transaction Signatures), as defined in RFC 2845.
84     </para>
85     <para>
86       The <option>name</option> of the key is specified on the command
87       line.  For DNSSEC keys, this must match the name of the zone for
88       which the key is being generated.
89     </para>
90   </refsect1>
91
92   <refsect1>
93     <title>OPTIONS</title>
94
95     <variablelist>
96       <varlistentry>
97         <term>-a <replaceable class="parameter">algorithm</replaceable></term>
98         <listitem>
99           <para>
100             Selects the cryptographic algorithm.  For DNSSEC keys, the value
101             of <option>algorithm</option> must be one of RSAMD5, RSASHA1,
102             DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256 or RSASHA512.
103             For TSIG/TKEY, the value must
104             be DH (Diffie Hellman), HMAC-MD5, HMAC-SHA1, HMAC-SHA224,
105             HMAC-SHA256, HMAC-SHA384, or HMAC-SHA512.  These values are
106             case insensitive.
107           </para>
108           <para>
109             Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement
110             algorithm, and DSA is recommended.  For TSIG, HMAC-MD5 is
111             mandatory.
112           </para>
113           <para>
114             Note 2: HMAC-MD5 and DH automatically set the -k flag.
115           </para>
116         </listitem>
117       </varlistentry>
118
119       <varlistentry>
120         <term>-b <replaceable class="parameter">keysize</replaceable></term>
121         <listitem>
122           <para>
123             Specifies the number of bits in the key.  The choice of key
124             size depends on the algorithm used.  RSA keys must be
125             between 512 and 2048 bits.  Diffie Hellman keys must be between
126             128 and 4096 bits.  DSA keys must be between 512 and 1024
127             bits and an exact multiple of 64.  HMAC keys must be
128             between 1 and 512 bits.
129           </para>
130         </listitem>
131       </varlistentry>
132
133       <varlistentry>
134         <term>-n <replaceable class="parameter">nametype</replaceable></term>
135         <listitem>
136           <para>
137             Specifies the owner type of the key.  The value of
138             <option>nametype</option> must either be ZONE (for a DNSSEC
139             zone key (KEY/DNSKEY)), HOST or ENTITY (for a key associated with
140             a host (KEY)),
141             USER (for a key associated with a user(KEY)) or OTHER (DNSKEY).
142             These values are case insensitive.  Defaults to ZONE for DNSKEY
143             generation.
144           </para>
145         </listitem>
146       </varlistentry>
147
148       <varlistentry>
149         <term>-c <replaceable class="parameter">class</replaceable></term>
150         <listitem>
151           <para>
152             Indicates that the DNS record containing the key should have
153             the specified class.  If not specified, class IN is used.
154           </para>
155         </listitem>
156       </varlistentry>
157
158       <varlistentry>
159         <term>-e</term>
160         <listitem>
161           <para>
162             If generating an RSAMD5/RSASHA1 key, use a large exponent.
163           </para>
164         </listitem>
165       </varlistentry>
166
167       <varlistentry>
168         <term>-f <replaceable class="parameter">flag</replaceable></term>
169         <listitem>
170           <para>
171             Set the specified flag in the flag field of the KEY/DNSKEY record.
172                         The only recognized flag is KSK (Key Signing Key) DNSKEY.
173           </para>
174         </listitem>
175       </varlistentry>
176
177       <varlistentry>
178         <term>-g <replaceable class="parameter">generator</replaceable></term>
179         <listitem>
180           <para>
181             If generating a Diffie Hellman key, use this generator.
182             Allowed values are 2 and 5.  If no generator
183             is specified, a known prime from RFC 2539 will be used
184             if possible; otherwise the default is 2.
185           </para>
186         </listitem>
187       </varlistentry>
188
189       <varlistentry>
190         <term>-h</term>
191         <listitem>
192           <para>
193             Prints a short summary of the options and arguments to
194             <command>dnssec-keygen</command>.
195           </para>
196         </listitem>
197       </varlistentry>
198
199       <varlistentry>
200         <term>-k</term>
201         <listitem>
202           <para>
203             Generate KEY records rather than DNSKEY records.
204           </para>
205         </listitem>
206       </varlistentry>
207
208       <varlistentry>
209         <term>-p <replaceable class="parameter">protocol</replaceable></term>
210         <listitem>
211           <para>
212             Sets the protocol value for the generated key.  The protocol
213             is a number between 0 and 255.  The default is 3 (DNSSEC).
214             Other possible values for this argument are listed in
215             RFC 2535 and its successors.
216           </para>
217         </listitem>
218       </varlistentry>
219
220       <varlistentry>
221         <term>-r <replaceable class="parameter">randomdev</replaceable></term>
222         <listitem>
223           <para>
224             Specifies the source of randomness.  If the operating
225             system does not provide a <filename>/dev/random</filename>
226             or equivalent device, the default source of randomness
227             is keyboard input.  <filename>randomdev</filename>
228             specifies
229             the name of a character device or file containing random
230             data to be used instead of the default.  The special value
231             <filename>keyboard</filename> indicates that keyboard
232             input should be used.
233           </para>
234         </listitem>
235       </varlistentry>
236
237       <varlistentry>
238         <term>-s <replaceable class="parameter">strength</replaceable></term>
239         <listitem>
240           <para>
241             Specifies the strength value of the key.  The strength is
242             a number between 0 and 15, and currently has no defined
243             purpose in DNSSEC.
244           </para>
245         </listitem>
246       </varlistentry>
247
248       <varlistentry>
249         <term>-t <replaceable class="parameter">type</replaceable></term>
250         <listitem>
251           <para>
252             Indicates the use of the key.  <option>type</option> must be
253             one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF.  The default
254             is AUTHCONF.  AUTH refers to the ability to authenticate
255             data, and CONF the ability to encrypt data.
256           </para>
257         </listitem>
258       </varlistentry>
259
260       <varlistentry>
261         <term>-v <replaceable class="parameter">level</replaceable></term>
262         <listitem>
263           <para>
264             Sets the debugging level.
265           </para>
266         </listitem>
267       </varlistentry>
268
269     </variablelist>
270   </refsect1>
271
272   <refsect1>
273     <title>GENERATED KEYS</title>
274     <para>
275       When <command>dnssec-keygen</command> completes
276       successfully,
277       it prints a string of the form <filename>Knnnn.+aaa+iiiii</filename>
278       to the standard output.  This is an identification string for
279       the key it has generated.
280     </para>
281     <itemizedlist>
282       <listitem>
283         <para><filename>nnnn</filename> is the key name.
284         </para>
285       </listitem>
286       <listitem>
287         <para><filename>aaa</filename> is the numeric representation
288           of the
289           algorithm.
290         </para>
291       </listitem>
292       <listitem>
293         <para><filename>iiiii</filename> is the key identifier (or
294           footprint).
295         </para>
296       </listitem>
297     </itemizedlist>
298     <para><command>dnssec-keygen</command> 
299       creates two files, with names based
300       on the printed string.  <filename>Knnnn.+aaa+iiiii.key</filename>
301       contains the public key, and
302       <filename>Knnnn.+aaa+iiiii.private</filename> contains the
303       private
304       key.
305     </para>
306     <para>
307       The <filename>.key</filename> file contains a DNS KEY record
308       that
309       can be inserted into a zone file (directly or with a $INCLUDE
310       statement).
311     </para>
312     <para>
313       The <filename>.private</filename> file contains
314       algorithm-specific
315       fields.  For obvious security reasons, this file does not have
316       general read permission.
317     </para>
318     <para>
319       Both <filename>.key</filename> and <filename>.private</filename>
320       files are generated for symmetric encryption algorithms such as
321       HMAC-MD5, even though the public and private key are equivalent.
322     </para>
323   </refsect1>
324
325   <refsect1>
326     <title>EXAMPLE</title>
327     <para>
328       To generate a 768-bit DSA key for the domain
329       <userinput>example.com</userinput>, the following command would be
330       issued:
331     </para>
332     <para><userinput>dnssec-keygen -a DSA -b 768 -n ZONE example.com</userinput>
333     </para>
334     <para>
335       The command would print a string of the form:
336     </para>
337     <para><userinput>Kexample.com.+003+26160</userinput>
338     </para>
339     <para>
340       In this example, <command>dnssec-keygen</command> creates
341       the files <filename>Kexample.com.+003+26160.key</filename>
342       and
343       <filename>Kexample.com.+003+26160.private</filename>.
344     </para>
345   </refsect1>
346
347   <refsect1>
348     <title>SEE ALSO</title>
349     <para><citerefentry>
350         <refentrytitle>dnssec-signzone</refentrytitle><manvolnum>8</manvolnum>
351       </citerefentry>,
352       <citetitle>BIND 9 Administrator Reference Manual</citetitle>,
353       <citetitle>RFC 2539</citetitle>,
354       <citetitle>RFC 2845</citetitle>,
355       <citetitle>RFC 4034</citetitle>.
356     </para>
357   </refsect1>
358
359   <refsect1>
360     <title>AUTHOR</title>
361     <para><corpauthor>Internet Systems Consortium</corpauthor>
362     </para>
363   </refsect1>
364
365 </refentry><!--
366  - Local variables:
367  - mode: sgml
368  - End:
369 -->