]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/bind9/bin/dnssec/dnssec-keygen.8
MFC r363988:
[FreeBSD/stable/9.git] / contrib / bind9 / bin / dnssec / dnssec-keygen.8
1 .\" Copyright (C) 2004, 2005, 2007-2012, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000-2003 Internet Software Consortium.
3 .\" 
4 .\" Permission to use, copy, modify, and/or distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\" 
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 .\" PERFORMANCE OF THIS SOFTWARE.
15 .\"
16 .hy 0
17 .ad l
18 '\" t
19 .\"     Title: dnssec-keygen
20 .\"    Author: 
21 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
22 .\"      Date: 2014-02-07
23 .\"    Manual: BIND9
24 .\"    Source: ISC
25 .\"  Language: English
26 .\"
27 .TH "DNSSEC\-KEYGEN" "8" "2014\-02\-07" "ISC" "BIND9"
28 .\" -----------------------------------------------------------------
29 .\" * Define some portability stuff
30 .\" -----------------------------------------------------------------
31 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 .\" http://bugs.debian.org/507673
33 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 .ie \n(.g .ds Aq \(aq
36 .el       .ds Aq '
37 .\" -----------------------------------------------------------------
38 .\" * set default formatting
39 .\" -----------------------------------------------------------------
40 .\" disable hyphenation
41 .nh
42 .\" disable justification (adjust text to left margin only)
43 .ad l
44 .\" -----------------------------------------------------------------
45 .\" * MAIN CONTENT STARTS HERE *
46 .\" -----------------------------------------------------------------
47 .SH "NAME"
48 dnssec-keygen \- DNSSEC key generation tool
49 .SH "SYNOPSIS"
50 .HP \w'\fBdnssec\-keygen\fR\ 'u
51 \fBdnssec\-keygen\fR [\fB\-a\ \fR\fB\fIalgorithm\fR\fR] [\fB\-b\ \fR\fB\fIkeysize\fR\fR] [\fB\-n\ \fR\fB\fInametype\fR\fR] [\fB\-3\fR] [\fB\-A\ \fR\fB\fIdate/offset\fR\fR] [\fB\-C\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-D\ \fR\fB\fIdate/offset\fR\fR] [\fB\-E\ \fR\fB\fIengine\fR\fR] [\fB\-f\ \fR\fB\fIflag\fR\fR] [\fB\-G\fR] [\fB\-g\ \fR\fB\fIgenerator\fR\fR] [\fB\-h\fR] [\fB\-I\ \fR\fB\fIdate/offset\fR\fR] [\fB\-i\ \fR\fB\fIinterval\fR\fR] [\fB\-K\ \fR\fB\fIdirectory\fR\fR] [\fB\-L\ \fR\fB\fIttl\fR\fR] [\fB\-k\fR] [\fB\-P\ \fR\fB\fIdate/offset\fR\fR] [\fB\-p\ \fR\fB\fIprotocol\fR\fR] [\fB\-q\fR] [\fB\-R\ \fR\fB\fIdate/offset\fR\fR] [\fB\-r\ \fR\fB\fIrandomdev\fR\fR] [\fB\-S\ \fR\fB\fIkey\fR\fR] [\fB\-s\ \fR\fB\fIstrength\fR\fR] [\fB\-t\ \fR\fB\fItype\fR\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-V\fR] [\fB\-z\fR] {name}
52 .SH "DESCRIPTION"
53 .PP
54 \fBdnssec\-keygen\fR
55 generates keys for DNSSEC (Secure DNS), as defined in RFC 2535 and RFC 4034\&. It can also generate keys for use with TSIG (Transaction Signatures) as defined in RFC 2845, or TKEY (Transaction Key) as defined in RFC 2930\&.
56 .PP
57 The
58 \fBname\fR
59 of the key is specified on the command line\&. For DNSSEC keys, this must match the name of the zone for which the key is being generated\&.
60 .SH "OPTIONS"
61 .PP
62 \-a \fIalgorithm\fR
63 .RS 4
64 Selects the cryptographic algorithm\&. For DNSSEC keys, the value of
65 \fBalgorithm\fR
66 must be one of RSAMD5, RSASHA1, DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512, ECCGOST, ECDSAP256SHA256 or ECDSAP384SHA384\&. For TSIG/TKEY, the value must be DH (Diffie Hellman), HMAC\-MD5, HMAC\-SHA1, HMAC\-SHA224, HMAC\-SHA256, HMAC\-SHA384, or HMAC\-SHA512\&. These values are case insensitive\&.
67 .sp
68 If no algorithm is specified, then RSASHA1 will be used by default, unless the
69 \fB\-3\fR
70 option is specified, in which case NSEC3RSASHA1 will be used instead\&. (If
71 \fB\-3\fR
72 is used and an algorithm is specified, that algorithm will be checked for compatibility with NSEC3\&.)
73 .sp
74 Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement algorithm, and DSA is recommended\&. For TSIG, HMAC\-MD5 is mandatory\&.
75 .sp
76 Note 2: DH, HMAC\-MD5, and HMAC\-SHA1 through HMAC\-SHA512 automatically set the \-T KEY option\&.
77 .RE
78 .PP
79 \-b \fIkeysize\fR
80 .RS 4
81 Specifies the number of bits in the key\&. The choice of key size depends on the algorithm used\&. RSA keys must be between 512 and 2048 bits\&. Diffie Hellman keys must be between 128 and 4096 bits\&. DSA keys must be between 512 and 1024 bits and an exact multiple of 64\&. HMAC keys must be between 1 and 512 bits\&. Elliptic curve algorithms don\*(Aqt need this parameter\&.
82 .sp
83 The key size does not need to be specified if using a default algorithm\&. The default key size is 1024 bits for zone signing keys (ZSK\*(Aqs) and 2048 bits for key signing keys (KSK\*(Aqs, generated with
84 \fB\-f KSK\fR)\&. However, if an algorithm is explicitly specified with the
85 \fB\-a\fR, then there is no default key size, and the
86 \fB\-b\fR
87 must be used\&.
88 .RE
89 .PP
90 \-n \fInametype\fR
91 .RS 4
92 Specifies the owner type of the key\&. The value of
93 \fBnametype\fR
94 must either be ZONE (for a DNSSEC zone key (KEY/DNSKEY)), HOST or ENTITY (for a key associated with a host (KEY)), USER (for a key associated with a user(KEY)) or OTHER (DNSKEY)\&. These values are case insensitive\&. Defaults to ZONE for DNSKEY generation\&.
95 .RE
96 .PP
97 \-3
98 .RS 4
99 Use an NSEC3\-capable algorithm to generate a DNSSEC key\&. If this option is used and no algorithm is explicitly set on the command line, NSEC3RSASHA1 will be used by default\&. Note that RSASHA256, RSASHA512, ECCGOST, ECDSAP256SHA256 and ECDSAP384SHA384 algorithms are NSEC3\-capable\&.
100 .RE
101 .PP
102 \-C
103 .RS 4
104 Compatibility mode: generates an old\-style key, without any metadata\&. By default,
105 \fBdnssec\-keygen\fR
106 will include the key\*(Aqs creation date in the metadata stored with the private key, and other dates may be set there as well (publication date, activation date, etc)\&. Keys that include this data may be incompatible with older versions of BIND; the
107 \fB\-C\fR
108 option suppresses them\&.
109 .RE
110 .PP
111 \-c \fIclass\fR
112 .RS 4
113 Indicates that the DNS record containing the key should have the specified class\&. If not specified, class IN is used\&.
114 .RE
115 .PP
116 \-E \fIengine\fR
117 .RS 4
118 Uses a crypto hardware (OpenSSL engine) for random number and, when supported, key generation\&. When compiled with PKCS#11 support it defaults to pkcs11; the empty name resets it to no engine\&.
119 .RE
120 .PP
121 \-f \fIflag\fR
122 .RS 4
123 Set the specified flag in the flag field of the KEY/DNSKEY record\&. The only recognized flags are KSK (Key Signing Key) and REVOKE\&.
124 .RE
125 .PP
126 \-G
127 .RS 4
128 Generate a key, but do not publish it or sign with it\&. This option is incompatible with \-P and \-A\&.
129 .RE
130 .PP
131 \-g \fIgenerator\fR
132 .RS 4
133 If generating a Diffie Hellman key, use this generator\&. Allowed values are 2 and 5\&. If no generator is specified, a known prime from RFC 2539 will be used if possible; otherwise the default is 2\&.
134 .RE
135 .PP
136 \-h
137 .RS 4
138 Prints a short summary of the options and arguments to
139 \fBdnssec\-keygen\fR\&.
140 .RE
141 .PP
142 \-K \fIdirectory\fR
143 .RS 4
144 Sets the directory in which the key files are to be written\&.
145 .RE
146 .PP
147 \-k
148 .RS 4
149 Deprecated in favor of \-T KEY\&.
150 .RE
151 .PP
152 \-L \fIttl\fR
153 .RS 4
154 Sets the default TTL to use for this key when it is converted into a DNSKEY RR\&. If the key is imported into a zone, this is the TTL that will be used for it, unless there was already a DNSKEY RRset in place, in which case the existing TTL would take precedence\&. If this value is not set and there is no existing DNSKEY RRset, the TTL will default to the SOA TTL\&. Setting the default TTL to
155 0
156 or
157 none
158 is the same as leaving it unset\&.
159 .RE
160 .PP
161 \-p \fIprotocol\fR
162 .RS 4
163 Sets the protocol value for the generated key\&. The protocol is a number between 0 and 255\&. The default is 3 (DNSSEC)\&. Other possible values for this argument are listed in RFC 2535 and its successors\&.
164 .RE
165 .PP
166 \-q
167 .RS 4
168 Quiet mode: Suppresses unnecessary output, including progress indication\&. Without this option, when
169 \fBdnssec\-keygen\fR
170 is run interactively to generate an RSA or DSA key pair, it will print a string of symbols to
171 stderr
172 indicating the progress of the key generation\&. A \*(Aq\&.\*(Aq indicates that a random number has been found which passed an initial sieve test; \*(Aq+\*(Aq means a number has passed a single round of the Miller\-Rabin primality test; a space means that the number has passed all the tests and is a satisfactory key\&.
173 .RE
174 .PP
175 \-r \fIrandomdev\fR
176 .RS 4
177 Specifies the source of randomness\&. If the operating system does not provide a
178 /dev/random
179 or equivalent device, the default source of randomness is keyboard input\&.
180 randomdev
181 specifies the name of a character device or file containing random data to be used instead of the default\&. The special value
182 keyboard
183 indicates that keyboard input should be used\&.
184 .RE
185 .PP
186 \-S \fIkey\fR
187 .RS 4
188 Create a new key which is an explicit successor to an existing key\&. The name, algorithm, size, and type of the key will be set to match the existing key\&. The activation date of the new key will be set to the inactivation date of the existing one\&. The publication date will be set to the activation date minus the prepublication interval, which defaults to 30 days\&.
189 .RE
190 .PP
191 \-s \fIstrength\fR
192 .RS 4
193 Specifies the strength value of the key\&. The strength is a number between 0 and 15, and currently has no defined purpose in DNSSEC\&.
194 .RE
195 .PP
196 \-T \fIrrtype\fR
197 .RS 4
198 Specifies the resource record type to use for the key\&.
199 \fBrrtype\fR
200 must be either DNSKEY or KEY\&. The default is DNSKEY when using a DNSSEC algorithm, but it can be overridden to KEY for use with SIG(0)\&.
201 Using any TSIG algorithm (HMAC\-* or DH) forces this option to KEY\&.
202 .RE
203 .PP
204 \-t \fItype\fR
205 .RS 4
206 Indicates the use of the key\&.
207 \fBtype\fR
208 must be one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF\&. The default is AUTHCONF\&. AUTH refers to the ability to authenticate data, and CONF the ability to encrypt data\&.
209 .RE
210 .PP
211 \-v \fIlevel\fR
212 .RS 4
213 Sets the debugging level\&.
214 .RE
215 .PP
216 \-V
217 .RS 4
218 Prints version information\&.
219 .RE
220 .SH "TIMING OPTIONS"
221 .PP
222 Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS\&. If the argument begins with a \*(Aq+\*(Aq or \*(Aq\-\*(Aq, it is interpreted as an offset from the present time\&. For convenience, if such an offset is followed by one of the suffixes \*(Aqy\*(Aq, \*(Aqmo\*(Aq, \*(Aqw\*(Aq, \*(Aqd\*(Aq, \*(Aqh\*(Aq, or \*(Aqmi\*(Aq, then the offset is computed in years (defined as 365 24\-hour days, ignoring leap years), months (defined as 30 24\-hour days), weeks, days, hours, or minutes, respectively\&. Without a suffix, the offset is computed in seconds\&. To explicitly prevent a date from being set, use \*(Aqnone\*(Aq or \*(Aqnever\*(Aq\&.
223 .PP
224 \-P \fIdate/offset\fR
225 .RS 4
226 Sets the date on which a key is to be published to the zone\&. After that date, the key will be included in the zone but will not be used to sign it\&. If not set, and if the \-G option has not been used, the default is "now"\&.
227 .RE
228 .PP
229 \-A \fIdate/offset\fR
230 .RS 4
231 Sets the date on which the key is to be activated\&. After that date, the key will be included in the zone and used to sign it\&. If not set, and if the \-G option has not been used, the default is "now"\&. If set, if and \-P is not set, then the publication date will be set to the activation date minus the prepublication interval\&.
232 .RE
233 .PP
234 \-R \fIdate/offset\fR
235 .RS 4
236 Sets the date on which the key is to be revoked\&. After that date, the key will be flagged as revoked\&. It will be included in the zone and will be used to sign it\&.
237 .RE
238 .PP
239 \-I \fIdate/offset\fR
240 .RS 4
241 Sets the date on which the key is to be retired\&. After that date, the key will still be included in the zone, but it will not be used to sign it\&.
242 .RE
243 .PP
244 \-D \fIdate/offset\fR
245 .RS 4
246 Sets the date on which the key is to be deleted\&. After that date, the key will no longer be included in the zone\&. (It may remain in the key repository, however\&.)
247 .RE
248 .PP
249 \-i \fIinterval\fR
250 .RS 4
251 Sets the prepublication interval for a key\&. If set, then the publication and activation dates must be separated by at least this much time\&. If the activation date is specified but the publication date isn\*(Aqt, then the publication date will default to this much time before the activation date; conversely, if the publication date is specified but activation date isn\*(Aqt, then activation will be set to this much time after publication\&.
252 .sp
253 If the key is being created as an explicit successor to another key, then the default prepublication interval is 30 days; otherwise it is zero\&.
254 .sp
255 As with date offsets, if the argument is followed by one of the suffixes \*(Aqy\*(Aq, \*(Aqmo\*(Aq, \*(Aqw\*(Aq, \*(Aqd\*(Aq, \*(Aqh\*(Aq, or \*(Aqmi\*(Aq, then the interval is measured in years, months, weeks, days, hours, or minutes, respectively\&. Without a suffix, the interval is measured in seconds\&.
256 .RE
257 .SH "GENERATED KEYS"
258 .PP
259 When
260 \fBdnssec\-keygen\fR
261 completes successfully, it prints a string of the form
262 Knnnn\&.+aaa+iiiii
263 to the standard output\&. This is an identification string for the key it has generated\&.
264 .sp
265 .RS 4
266 .ie n \{\
267 \h'-04'\(bu\h'+03'\c
268 .\}
269 .el \{\
270 .sp -1
271 .IP \(bu 2.3
272 .\}
273 nnnn
274 is the key name\&.
275 .RE
276 .sp
277 .RS 4
278 .ie n \{\
279 \h'-04'\(bu\h'+03'\c
280 .\}
281 .el \{\
282 .sp -1
283 .IP \(bu 2.3
284 .\}
285 aaa
286 is the numeric representation of the algorithm\&.
287 .RE
288 .sp
289 .RS 4
290 .ie n \{\
291 \h'-04'\(bu\h'+03'\c
292 .\}
293 .el \{\
294 .sp -1
295 .IP \(bu 2.3
296 .\}
297 iiiii
298 is the key identifier (or footprint)\&.
299 .RE
300 .PP
301 \fBdnssec\-keygen\fR
302 creates two files, with names based on the printed string\&.
303 Knnnn\&.+aaa+iiiii\&.key
304 contains the public key, and
305 Knnnn\&.+aaa+iiiii\&.private
306 contains the private key\&.
307 .PP
308 The
309 \&.key
310 file contains a DNS KEY record that can be inserted into a zone file (directly or with a $INCLUDE statement)\&.
311 .PP
312 The
313 \&.private
314 file contains algorithm\-specific fields\&. For obvious security reasons, this file does not have general read permission\&.
315 .PP
316 Both
317 \&.key
318 and
319 \&.private
320 files are generated for symmetric encryption algorithms such as HMAC\-MD5, even though the public and private key are equivalent\&.
321 .SH "EXAMPLE"
322 .PP
323 To generate a 768\-bit DSA key for the domain
324 \fBexample\&.com\fR, the following command would be issued:
325 .PP
326 \fBdnssec\-keygen \-a DSA \-b 768 \-n ZONE example\&.com\fR
327 .PP
328 The command would print a string of the form:
329 .PP
330 \fBKexample\&.com\&.+003+26160\fR
331 .PP
332 In this example,
333 \fBdnssec\-keygen\fR
334 creates the files
335 Kexample\&.com\&.+003+26160\&.key
336 and
337 Kexample\&.com\&.+003+26160\&.private\&.
338 .SH "SEE ALSO"
339 .PP
340 \fBdnssec-signzone\fR(8),
341 BIND 9 Administrator Reference Manual,
342 RFC 2539,
343 RFC 2845,
344 RFC 4034\&.
345 .SH "AUTHOR"
346 .PP
347 \fBInternet Systems Consortium, Inc\&.\fR
348 .SH "COPYRIGHT"
349 .br
350 Copyright \(co 2004, 2005, 2007-2012, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
351 .br
352 Copyright \(co 2000-2003 Internet Software Consortium.
353 .br