summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/bin/dnssec/dnssec-keygen.html
blob: 2c1e379609e0b4b97bccd561469bd343065668b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
<!--
 - Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
 - Copyright (C) 2001-2003  Internet Software Consortium.
 -
 - Permission to use, copy, modify, and distribute this software for any
 - purpose with or without fee is hereby granted, provided that the above
 - copyright notice and this permission notice appear in all copies.
 -
 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 - PERFORMANCE OF THIS SOFTWARE.
-->

<!-- $ISC: dnssec-keygen.html,v 1.5.2.1.4.6 2004/08/22 23:38:58 marka Exp $ -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>dnssec-keygen</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><H1
><A
NAME="AEN1"
></A
><SPAN
CLASS="APPLICATION"
>dnssec-keygen</SPAN
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN9"
></A
><H2
>Name</H2
><SPAN
CLASS="APPLICATION"
>dnssec-keygen</SPAN
>&nbsp;--&nbsp;DNSSEC key generation tool</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN13"
></A
><H2
>Synopsis</H2
><P
><B
CLASS="COMMAND"
>dnssec-keygen</B
>  {-a <VAR
CLASS="REPLACEABLE"
>algorithm</VAR
>} {-b <VAR
CLASS="REPLACEABLE"
>keysize</VAR
>} {-n <VAR
CLASS="REPLACEABLE"
>nametype</VAR
>} [<VAR
CLASS="OPTION"
>-c <VAR
CLASS="REPLACEABLE"
>class</VAR
></VAR
>] [<VAR
CLASS="OPTION"
>-e</VAR
>] [<VAR
CLASS="OPTION"
>-f <VAR
CLASS="REPLACEABLE"
>flag</VAR
></VAR
>] [<VAR
CLASS="OPTION"
>-g <VAR
CLASS="REPLACEABLE"
>generator</VAR
></VAR
>] [<VAR
CLASS="OPTION"
>-h</VAR
>] [<VAR
CLASS="OPTION"
>-k</VAR
>] [<VAR
CLASS="OPTION"
>-p <VAR
CLASS="REPLACEABLE"
>protocol</VAR
></VAR
>] [<VAR
CLASS="OPTION"
>-r <VAR
CLASS="REPLACEABLE"
>randomdev</VAR
></VAR
>] [<VAR
CLASS="OPTION"
>-s <VAR
CLASS="REPLACEABLE"
>strength</VAR
></VAR
>] [<VAR
CLASS="OPTION"
>-t <VAR
CLASS="REPLACEABLE"
>type</VAR
></VAR
>] [<VAR
CLASS="OPTION"
>-v <VAR
CLASS="REPLACEABLE"
>level</VAR
></VAR
>] {name}</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN53"
></A
><H2
>DESCRIPTION</H2
><P
>        <B
CLASS="COMMAND"
>dnssec-keygen</B
> generates keys for DNSSEC
	(Secure DNS), as defined in RFC 2535 and RFC &lt;TBA\&gt;.  It can also generate
	keys for use with TSIG (Transaction Signatures), as
	defined in RFC 2845.
    </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN57"
></A
><H2
>OPTIONS</H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>-a <VAR
CLASS="REPLACEABLE"
>algorithm</VAR
></DT
><DD
><P
>	      Selects the cryptographic algorithm.  The value of
	      <VAR
CLASS="OPTION"
>algorithm</VAR
> must be one of RSAMD5 (RSA) or RSASHA1,
	      DSA, DH (Diffie Hellman), or HMAC-MD5.  These values
	      are case insensitive.
	  </P
><P
>	      Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement algorithm,
	      and DSA is recommended.  For TSIG, HMAC-MD5 is mandatory.
	  </P
><P
>	      Note 2: HMAC-MD5 and DH automatically set the -k flag.
	  </P
></DD
><DT
>-b <VAR
CLASS="REPLACEABLE"
>keysize</VAR
></DT
><DD
><P
>	       Specifies the number of bits in the key.  The choice of key
	       size depends on the algorithm used.  RSAMD5 / RSASHA1 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-MD5 keys must be
	       between 1 and 512 bits.
	  </P
></DD
><DT
>-n <VAR
CLASS="REPLACEABLE"
>nametype</VAR
></DT
><DD
><P
>	       Specifies the owner type of the key.  The value of
	       <VAR
CLASS="OPTION"
>nametype</VAR
> 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.
	  </P
></DD
><DT
>-c <VAR
CLASS="REPLACEABLE"
>class</VAR
></DT
><DD
><P
>	       Indicates that the DNS record containing the key should have
	       the specified class.  If not specified, class IN is used.
	  </P
></DD
><DT
>-e</DT
><DD
><P
>	       If generating an RSAMD5/RSASHA1 key, use a large exponent.
	  </P
></DD
><DT
>-f <VAR
CLASS="REPLACEABLE"
>flag</VAR
></DT
><DD
><P
>		Set the specified flag in the flag field of the KEY/DNSKEY record.
		The only recognized flag is KSK (Key Signing Key) DNSKEY.
	  </P
></DD
><DT
>-g <VAR
CLASS="REPLACEABLE"
>generator</VAR
></DT
><DD
><P
>	       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.
	  </P
></DD
><DT
>-h</DT
><DD
><P
>	       Prints a short summary of the options and arguments to
	       <B
CLASS="COMMAND"
>dnssec-keygen</B
>.
	  </P
></DD
><DT
>-k</DT
><DD
><P
>	       Generate KEY records rather than DNSKEY records.
	  </P
></DD
><DT
>-p <VAR
CLASS="REPLACEABLE"
>protocol</VAR
></DT
><DD
><P
>	       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.
	  </P
></DD
><DT
>-r <VAR
CLASS="REPLACEABLE"
>randomdev</VAR
></DT
><DD
><P
>	       Specifies the source of randomness.  If the operating
	       system does not provide a <TT
CLASS="FILENAME"
>/dev/random</TT
>
	       or equivalent device, the default source of randomness
	       is keyboard input.  <TT
CLASS="FILENAME"
>randomdev</TT
> specifies
	       the name of a character device or file containing random
	       data to be used instead of the default.  The special value
	       <TT
CLASS="FILENAME"
>keyboard</TT
> indicates that keyboard
	       input should be used.
	  </P
></DD
><DT
>-s <VAR
CLASS="REPLACEABLE"
>strength</VAR
></DT
><DD
><P
>	       Specifies the strength value of the key.  The strength is
	       a number between 0 and 15, and currently has no defined
	       purpose in DNSSEC.
	  </P
></DD
><DT
>-t <VAR
CLASS="REPLACEABLE"
>type</VAR
></DT
><DD
><P
>	       Indicates the use of the key.  <VAR
CLASS="OPTION"
>type</VAR
> 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.
	  </P
></DD
><DT
>-v <VAR
CLASS="REPLACEABLE"
>level</VAR
></DT
><DD
><P
>	       Sets the debugging level.
	  </P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN136"
></A
><H2
>GENERATED KEYS</H2
><P
>        When <B
CLASS="COMMAND"
>dnssec-keygen</B
> completes successfully,
	it prints a string of the form <TT
CLASS="FILENAME"
>Knnnn.+aaa+iiiii</TT
>
	to the standard output.  This is an identification string for
	the key it has generated.  These strings can be used as arguments
	to <B
CLASS="COMMAND"
>dnssec-makekeyset</B
>.
    </P
><P
></P
><UL
><LI
><P
>          <TT
CLASS="FILENAME"
>nnnn</TT
> is the key name.
        </P
></LI
><LI
><P
>          <TT
CLASS="FILENAME"
>aaa</TT
> is the numeric representation of the
          algorithm.
        </P
></LI
><LI
><P
>          <TT
CLASS="FILENAME"
>iiiii</TT
> is the key identifier (or footprint).
        </P
></LI
></UL
><P
>        <B
CLASS="COMMAND"
>dnssec-keygen</B
> creates two file, with names based
	on the printed string.  <TT
CLASS="FILENAME"
>Knnnn.+aaa+iiiii.key</TT
>
	contains the public key, and
	<TT
CLASS="FILENAME"
>Knnnn.+aaa+iiiii.private</TT
> contains the private
	key.
    </P
><P
>        The <TT
CLASS="FILENAME"
>.key</TT
> file contains a DNS KEY record that
	can be inserted into a zone file (directly or with a $INCLUDE
	statement).
    </P
><P
>        The <TT
CLASS="FILENAME"
>.private</TT
> file contains algorithm specific
	fields.  For obvious security reasons, this file does not have
	general read permission.
    </P
><P
>        Both <TT
CLASS="FILENAME"
>.key</TT
> and <TT
CLASS="FILENAME"
>.private</TT
>
	files are generated for symmetric encryption algorithm such as
	HMAC-MD5, even though the public and private key are equivalent.
    </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN163"
></A
><H2
>EXAMPLE</H2
><P
>        To generate a 768-bit DSA key for the domain
	<KBD
CLASS="USERINPUT"
>example.com</KBD
>, the following command would be
	issued:
    </P
><P
>        <KBD
CLASS="USERINPUT"
>dnssec-keygen -a DSA -b 768 -n ZONE example.com</KBD
>
    </P
><P
>        The command would print a string of the form:
    </P
><P
>        <KBD
CLASS="USERINPUT"
>Kexample.com.+003+26160</KBD
>
    </P
><P
>        In this example, <B
CLASS="COMMAND"
>dnssec-keygen</B
> creates
	the files <TT
CLASS="FILENAME"
>Kexample.com.+003+26160.key</TT
> and
	<TT
CLASS="FILENAME"
>Kexample.com.+003+26160.private</TT
>
    </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN176"
></A
><H2
>SEE ALSO</H2
><P
>      <SPAN
CLASS="CITEREFENTRY"
><SPAN
CLASS="REFENTRYTITLE"
>dnssec-signzone</SPAN
>(8)</SPAN
>,
      <I
CLASS="CITETITLE"
>BIND 9 Administrator Reference Manual</I
>,
      <I
CLASS="CITETITLE"
>RFC 2535</I
>,
      <I
CLASS="CITETITLE"
>RFC 2845</I
>,
      <I
CLASS="CITETITLE"
>RFC 2539</I
>.
    </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN186"
></A
><H2
>AUTHOR</H2
><P
>        Internet Systems Consortium
    </P
></DIV
></BODY
></HTML
>