Update repub branch u/fanf2/patch to rebasing branch u/fanf2/rebasing revision v9_15_...
[ipreg/bind9.git] / bin / dnssec / dnssec-keygen.8
1 .\" Copyright (C) 2000-2005, 2007-2012, 2014-2019 Internet Systems Consortium, Inc. ("ISC")
2 .\"
3 .\" This Source Code Form is subject to the terms of the Mozilla Public
4 .\" License, v. 2.0. If a copy of the MPL was not distributed with this
5 .\" file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 .\"
7 .hy 0
8 .ad l
9 '\" t
10 .\" Title: dnssec-keygen
11 .\" Author:
12 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
13 .\" Date: August 21, 2015
14 .\" Manual: BIND9
15 .\" Source: ISC
16 .\" Language: English
17 .\"
18 .TH "DNSSEC\-KEYGEN" "8" "August 21, 2015" "ISC" "BIND9"
19 .\" -----------------------------------------------------------------
20 .\" * Define some portability stuff
21 .\" -----------------------------------------------------------------
22 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 .\" http://bugs.debian.org/507673
24 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
25 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 .ie \n(.g .ds Aq \(aq
27 .el .ds Aq '
28 .\" -----------------------------------------------------------------
29 .\" * set default formatting
30 .\" -----------------------------------------------------------------
31 .\" disable hyphenation
32 .nh
33 .\" disable justification (adjust text to left margin only)
34 .ad l
35 .\" -----------------------------------------------------------------
36 .\" * MAIN CONTENT STARTS HERE *
37 .\" -----------------------------------------------------------------
38 .SH "NAME"
39 dnssec-keygen \- DNSSEC key generation tool
40 .SH "SYNOPSIS"
41 .HP \w'\fBdnssec\-keygen\fR\ 'u
42 \fBdnssec\-keygen\fR [\fB\-3\fR] [\fB\-A\ \fR\fB\fIdate/offset\fR\fR] [\fB\-a\ \fR\fB\fIalgorithm\fR\fR] [\fB\-b\ \fR\fB\fIkeysize\fR\fR] [\fB\-C\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-D\ \fR\fB\fIdate/offset\fR\fR] [\fB\-D\ sync\ \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\-k\fR] [\fB\-L\ \fR\fB\fIttl\fR\fR] [\fB\-n\ \fR\fB\fInametype\fR\fR] [\fB\-P\ \fR\fB\fIdate/offset\fR\fR] [\fB\-P\ sync\ \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\-S\ \fR\fB\fIkey\fR\fR] [\fB\-s\ \fR\fB\fIstrength\fR\fR] [\fB\-t\ \fR\fB\fItype\fR\fR] [\fB\-V\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] {name}
43 .SH "DESCRIPTION"
44 .PP
45 \fBdnssec\-keygen\fR
46 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\&.
47 .PP
48 The
49 \fBname\fR
50 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\&.
51 .PP
52 The
53 \fBdnssec\-keymgr\fR
54 command acts as a wrapper around
55 \fBdnssec\-keygen\fR, generating and updating keys as needed to enforce defined security policies such as key rollover scheduling\&. Using
56 \fBdnssec\-keymgr\fR
57 may be preferable to direct use of
58 \fBdnssec\-keygen\fR\&.
59 .SH "OPTIONS"
60 .PP
61 \-3
62 .RS 4
63 Use an NSEC3\-capable algorithm to generate a DNSSEC key\&. If this option is used with an algorithm that has both NSEC and NSEC3 versions, then the NSEC3 version will be used; for example,
64 \fBdnssec\-keygen \-3a RSASHA1\fR
65 specifies the NSEC3RSASHA1 algorithm\&.
66 .RE
67 .PP
68 \-a \fIalgorithm\fR
69 .RS 4
70 Selects the cryptographic algorithm\&. For DNSSEC keys, the value of
71 \fBalgorithm\fR
72 must be one of RSASHA1, NSEC3RSASHA1, RSASHA256, RSASHA512, ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448\&. For TKEY, the value must be DH (Diffie Hellman); specifying his value will automatically set the
73 \fB\-T KEY\fR
74 option as well\&.
75 .sp
76 These values are case insensitive\&. In some cases, abbreviations are supported, such as ECDSA256 for ECDSAP256SHA256 and ECDSA384 for ECDSAP384SHA384\&. If RSASHA1 is specified along with the
77 \fB\-3\fR
78 option, then NSEC3RSASHA1 will be used instead\&.
79 .sp
80 This parameter
81 \fImust\fR
82 be specified except when using the
83 \fB\-S\fR
84 option, which copies the algorithm from the predecessor key\&.
85 .sp
86 In prior releases, HMAC algorithms could be generated for use as TSIG keys, but that feature has been removed as of BIND 9\&.13\&.0\&. Use
87 \fBtsig\-keygen\fR
88 to generate TSIG keys\&.
89 .RE
90 .PP
91 \-b \fIkeysize\fR
92 .RS 4
93 Specifies the number of bits in the key\&. The choice of key size depends on the algorithm used\&. RSA keys must be between 1024 and 4096 bits\&. Diffie Hellman keys must be between 128 and 4096 bits\&. Elliptic curve algorithms don\*(Aqt need this parameter\&.
94 .sp
95 If the key size is not specified, some algorithms have pre\-defined defaults\&. For example, RSA keys for use as DNSSEC zone signing keys have a default size of 1024 bits; RSA keys for use as key signing keys (KSKs, generated with
96 \fB\-f KSK\fR) default to 2048 bits\&.
97 .RE
98 .PP
99 \-C
100 .RS 4
101 Compatibility mode: generates an old\-style key, without any timing metadata\&. By default,
102 \fBdnssec\-keygen\fR
103 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
104 \fB\-C\fR
105 option suppresses them\&.
106 .RE
107 .PP
108 \-c \fIclass\fR
109 .RS 4
110 Indicates that the DNS record containing the key should have the specified class\&. If not specified, class IN is used\&.
111 .RE
112 .PP
113 \-E \fIengine\fR
114 .RS 4
115 Specifies the cryptographic hardware to use, when applicable\&.
116 .sp
117 When BIND is built with OpenSSL PKCS#11 support, this defaults to the string "pkcs11", which identifies an OpenSSL engine that can drive a cryptographic accelerator or hardware service module\&. When BIND is built with native PKCS#11 cryptography (\-\-enable\-native\-pkcs11), it defaults to the path of the PKCS#11 provider library specified via "\-\-with\-pkcs11"\&.
118 .RE
119 .PP
120 \-f \fIflag\fR
121 .RS 4
122 Set the specified flag in the flag field of the KEY/DNSKEY record\&. The only recognized flags are KSK (Key Signing Key) and REVOKE\&.
123 .RE
124 .PP
125 \-G
126 .RS 4
127 Generate a key, but do not publish it or sign with it\&. This option is incompatible with \-P and \-A\&.
128 .RE
129 .PP
130 \-g \fIgenerator\fR
131 .RS 4
132 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\&.
133 .RE
134 .PP
135 \-h
136 .RS 4
137 Prints a short summary of the options and arguments to
138 \fBdnssec\-keygen\fR\&.
139 .RE
140 .PP
141 \-K \fIdirectory\fR
142 .RS 4
143 Sets the directory in which the key files are to be written\&.
144 .RE
145 .PP
146 \-L \fIttl\fR
147 .RS 4
148 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
149 0
150 or
151 none
152 is the same as leaving it unset\&.
153 .RE
154 .PP
155 \-n \fInametype\fR
156 .RS 4
157 Specifies the owner type of the key\&. The value of
158 \fBnametype\fR
159 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\&.
160 .RE
161 .PP
162 \-p \fIprotocol\fR
163 .RS 4
164 Sets the protocol value for the generated key, for use with
165 \fB\-T KEY\fR\&. 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\&.
166 .RE
167 .PP
168 \-q
169 .RS 4
170 Quiet mode: Suppresses unnecessary output, including progress indication\&. Without this option, when
171 \fBdnssec\-keygen\fR
172 is run interactively to generate an RSA or DSA key pair, it will print a string of symbols to
173 stderr
174 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\&.
175 .RE
176 .PP
177 \-S \fIkey\fR
178 .RS 4
179 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\&.
180 .RE
181 .PP
182 \-s \fIstrength\fR
183 .RS 4
184 Specifies the strength value of the key\&. The strength is a number between 0 and 15, and currently has no defined purpose in DNSSEC\&.
185 .RE
186 .PP
187 \-T \fIrrtype\fR
188 .RS 4
189 Specifies the resource record type to use for the key\&.
190 \fBrrtype\fR
191 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)\&.
192 .RE
193 .PP
194 \-t \fItype\fR
195 .RS 4
196 Indicates the use of the key, for use with
197 \fB\-T KEY\fR\&.
198 \fBtype\fR
199 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\&.
200 .RE
201 .PP
202 \-V
203 .RS 4
204 Prints version information\&.
205 .RE
206 .PP
207 \-v \fIlevel\fR
208 .RS 4
209 Sets the debugging level\&.
210 .RE
211 .SH "TIMING OPTIONS"
212 .PP
213 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\&.
214 .PP
215 \-P \fIdate/offset\fR
216 .RS 4
217 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"\&.
218 .RE
219 .PP
220 \-P sync \fIdate/offset\fR
221 .RS 4
222 Sets the date on which CDS and CDNSKEY records that match this key are to be published to the zone\&.
223 .RE
224 .PP
225 \-A \fIdate/offset\fR
226 .RS 4
227 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\&.
228 .RE
229 .PP
230 \-R \fIdate/offset\fR
231 .RS 4
232 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\&.
233 .RE
234 .PP
235 \-I \fIdate/offset\fR
236 .RS 4
237 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\&.
238 .RE
239 .PP
240 \-D \fIdate/offset\fR
241 .RS 4
242 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\&.)
243 .RE
244 .PP
245 \-D sync \fIdate/offset\fR
246 .RS 4
247 Sets the date on which the CDS and CDNSKEY records that match this key are to be deleted\&.
248 .RE
249 .PP
250 \-i \fIinterval\fR
251 .RS 4
252 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\&.
253 .sp
254 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\&.
255 .sp
256 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\&.
257 .RE
258 .SH "GENERATED KEYS"
259 .PP
260 When
261 \fBdnssec\-keygen\fR
262 completes successfully, it prints a string of the form
263 Knnnn\&.+aaa+iiiii
264 to the standard output\&. This is an identification string for the key it has generated\&.
265 .sp
266 .RS 4
267 .ie n \{\
268 \h'-04'\(bu\h'+03'\c
269 .\}
270 .el \{\
271 .sp -1
272 .IP \(bu 2.3
273 .\}
274 nnnn
275 is the key name\&.
276 .RE
277 .sp
278 .RS 4
279 .ie n \{\
280 \h'-04'\(bu\h'+03'\c
281 .\}
282 .el \{\
283 .sp -1
284 .IP \(bu 2.3
285 .\}
286 aaa
287 is the numeric representation of the algorithm\&.
288 .RE
289 .sp
290 .RS 4
291 .ie n \{\
292 \h'-04'\(bu\h'+03'\c
293 .\}
294 .el \{\
295 .sp -1
296 .IP \(bu 2.3
297 .\}
298 iiiii
299 is the key identifier (or footprint)\&.
300 .RE
301 .PP
302 \fBdnssec\-keygen\fR
303 creates two files, with names based on the printed string\&.
304 Knnnn\&.+aaa+iiiii\&.key
305 contains the public key, and
306 Knnnn\&.+aaa+iiiii\&.private
307 contains the private key\&.
308 .PP
309 The
310 \&.key
311 file contains a DNSKEY or KEY record\&. When a zone is being signed by
312 \fBnamed\fR
313 or
314 \fBdnssec\-signzone\fR\fB\-S\fR, DNSKEY records are included automatically\&. In other cases, the
315 \&.key
316 file can be inserted into a zone file manually or with a
317 \fB$INCLUDE\fR
318 statement\&.
319 .PP
320 The
321 \&.private
322 file contains algorithm\-specific fields\&. For obvious security reasons, this file does not have general read permission\&.
323 .SH "EXAMPLE"
324 .PP
325 To generate an ECDSAP256SHA256 zone\-signing key for the zone
326 \fBexample\&.com\fR, issue the command:
327 .PP
328 \fBdnssec\-keygen \-a ECDSAP256SHA256 example\&.com\fR
329 .PP
330 The command would print a string of the form:
331 .PP
332 \fBKexample\&.com\&.+013+26160\fR
333 .PP
334 In this example,
335 \fBdnssec\-keygen\fR
336 creates the files
337 Kexample\&.com\&.+013+26160\&.key
338 and
339 Kexample\&.com\&.+013+26160\&.private\&.
340 .PP
341 To generate a matching key\-signing key, issue the command:
342 .PP
343 \fBdnssec\-keygen \-a ECDSAP256SHA256 \-f KSK example\&.com\fR
344 .SH "SEE ALSO"
345 .PP
346 \fBdnssec-signzone\fR(8),
347 BIND 9 Administrator Reference Manual,
348 RFC 2539,
349 RFC 2845,
350 RFC 4034\&.
351 .SH "AUTHOR"
352 .PP
353 \fBInternet Systems Consortium, Inc\&.\fR
354 .SH "COPYRIGHT"
355 .br
356 Copyright \(co 2000-2005, 2007-2012, 2014-2019 Internet Systems Consortium, Inc. ("ISC")
357 .br