/contrib/bind9/bin/dnssec/dnssec-keygen.docbook

https://bitbucket.org/freebsd/freebsd-head/ · Unknown · 613 lines · 568 code · 45 blank · 0 comment · 0 complexity · 5299345c394fb3cebf6b3f13222c680f MD5 · raw file

  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. <!-- $Id: dnssec-keygen.docbook,v 1.36 2010/12/23 04:07:59 marka Exp $ -->
  21. <refentry id="man.dnssec-keygen">
  22. <refentryinfo>
  23. <date>June 30, 2000</date>
  24. </refentryinfo>
  25. <refmeta>
  26. <refentrytitle><application>dnssec-keygen</application></refentrytitle>
  27. <manvolnum>8</manvolnum>
  28. <refmiscinfo>BIND9</refmiscinfo>
  29. </refmeta>
  30. <refnamediv>
  31. <refname><application>dnssec-keygen</application></refname>
  32. <refpurpose>DNSSEC key generation tool</refpurpose>
  33. </refnamediv>
  34. <docinfo>
  35. <copyright>
  36. <year>2004</year>
  37. <year>2005</year>
  38. <year>2007</year>
  39. <year>2008</year>
  40. <year>2009</year>
  41. <year>2010</year>
  42. <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
  43. </copyright>
  44. <copyright>
  45. <year>2000</year>
  46. <year>2001</year>
  47. <year>2002</year>
  48. <year>2003</year>
  49. <holder>Internet Software Consortium.</holder>
  50. </copyright>
  51. </docinfo>
  52. <refsynopsisdiv>
  53. <cmdsynopsis>
  54. <command>dnssec-keygen</command>
  55. <arg><option>-a <replaceable class="parameter">algorithm</replaceable></option></arg>
  56. <arg ><option>-b <replaceable class="parameter">keysize</replaceable></option></arg>
  57. <arg><option>-n <replaceable class="parameter">nametype</replaceable></option></arg>
  58. <arg><option>-3</option></arg>
  59. <arg><option>-A <replaceable class="parameter">date/offset</replaceable></option></arg>
  60. <arg><option>-C</option></arg>
  61. <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
  62. <arg><option>-D <replaceable class="parameter">date/offset</replaceable></option></arg>
  63. <arg><option>-E <replaceable class="parameter">engine</replaceable></option></arg>
  64. <arg><option>-e</option></arg>
  65. <arg><option>-f <replaceable class="parameter">flag</replaceable></option></arg>
  66. <arg><option>-G</option></arg>
  67. <arg><option>-g <replaceable class="parameter">generator</replaceable></option></arg>
  68. <arg><option>-h</option></arg>
  69. <arg><option>-I <replaceable class="parameter">date/offset</replaceable></option></arg>
  70. <arg><option>-i <replaceable class="parameter">interval</replaceable></option></arg>
  71. <arg><option>-K <replaceable class="parameter">directory</replaceable></option></arg>
  72. <arg><option>-k</option></arg>
  73. <arg><option>-P <replaceable class="parameter">date/offset</replaceable></option></arg>
  74. <arg><option>-p <replaceable class="parameter">protocol</replaceable></option></arg>
  75. <arg><option>-q</option></arg>
  76. <arg><option>-R <replaceable class="parameter">date/offset</replaceable></option></arg>
  77. <arg><option>-r <replaceable class="parameter">randomdev</replaceable></option></arg>
  78. <arg><option>-S <replaceable class="parameter">key</replaceable></option></arg>
  79. <arg><option>-s <replaceable class="parameter">strength</replaceable></option></arg>
  80. <arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
  81. <arg><option>-v <replaceable class="parameter">level</replaceable></option></arg>
  82. <arg><option>-z</option></arg>
  83. <arg choice="req">name</arg>
  84. </cmdsynopsis>
  85. </refsynopsisdiv>
  86. <refsect1>
  87. <title>DESCRIPTION</title>
  88. <para><command>dnssec-keygen</command>
  89. generates keys for DNSSEC (Secure DNS), as defined in RFC 2535
  90. and RFC 4034. It can also generate keys for use with
  91. TSIG (Transaction Signatures) as defined in RFC 2845, or TKEY
  92. (Transaction Key) as defined in RFC 2930.
  93. </para>
  94. <para>
  95. The <option>name</option> of the key is specified on the command
  96. line. For DNSSEC keys, this must match the name of the zone for
  97. which the key is being generated.
  98. </para>
  99. </refsect1>
  100. <refsect1>
  101. <title>OPTIONS</title>
  102. <variablelist>
  103. <varlistentry>
  104. <term>-a <replaceable class="parameter">algorithm</replaceable></term>
  105. <listitem>
  106. <para>
  107. Selects the cryptographic algorithm. For DNSSEC keys, the value
  108. of <option>algorithm</option> must be one of RSAMD5, RSASHA1,
  109. DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512 or ECCGOST.
  110. For TSIG/TKEY, the value must
  111. be DH (Diffie Hellman), HMAC-MD5, HMAC-SHA1, HMAC-SHA224,
  112. HMAC-SHA256, HMAC-SHA384, or HMAC-SHA512. These values are
  113. case insensitive.
  114. </para>
  115. <para>
  116. If no algorithm is specified, then RSASHA1 will be used by
  117. default, unless the <option>-3</option> option is specified,
  118. in which case NSEC3RSASHA1 will be used instead. (If
  119. <option>-3</option> is used and an algorithm is specified,
  120. that algorithm will be checked for compatibility with NSEC3.)
  121. </para>
  122. <para>
  123. Note 1: that for DNSSEC, RSASHA1 is a mandatory to implement
  124. algorithm, and DSA is recommended. For TSIG, HMAC-MD5 is
  125. mandatory.
  126. </para>
  127. <para>
  128. Note 2: DH, HMAC-MD5, and HMAC-SHA1 through HMAC-SHA512
  129. automatically set the -T KEY option.
  130. </para>
  131. </listitem>
  132. </varlistentry>
  133. <varlistentry>
  134. <term>-b <replaceable class="parameter">keysize</replaceable></term>
  135. <listitem>
  136. <para>
  137. Specifies the number of bits in the key. The choice of key
  138. size depends on the algorithm used. RSA keys must be
  139. between 512 and 2048 bits. Diffie Hellman keys must be between
  140. 128 and 4096 bits. DSA keys must be between 512 and 1024
  141. bits and an exact multiple of 64. HMAC keys must be
  142. between 1 and 512 bits.
  143. </para>
  144. <para>
  145. The key size does not need to be specified if using a default
  146. algorithm. The default key size is 1024 bits for zone signing
  147. keys (ZSK's) and 2048 bits for key signing keys (KSK's,
  148. generated with <option>-f KSK</option>). However, if an
  149. algorithm is explicitly specified with the <option>-a</option>,
  150. then there is no default key size, and the <option>-b</option>
  151. must be used.
  152. </para>
  153. </listitem>
  154. </varlistentry>
  155. <varlistentry>
  156. <term>-n <replaceable class="parameter">nametype</replaceable></term>
  157. <listitem>
  158. <para>
  159. Specifies the owner type of the key. The value of
  160. <option>nametype</option> must either be ZONE (for a DNSSEC
  161. zone key (KEY/DNSKEY)), HOST or ENTITY (for a key associated with
  162. a host (KEY)),
  163. USER (for a key associated with a user(KEY)) or OTHER (DNSKEY).
  164. These values are case insensitive. Defaults to ZONE for DNSKEY
  165. generation.
  166. </para>
  167. </listitem>
  168. </varlistentry>
  169. <varlistentry>
  170. <term>-3</term>
  171. <listitem>
  172. <para>
  173. Use an NSEC3-capable algorithm to generate a DNSSEC key.
  174. If this option is used and no algorithm is explicitly
  175. set on the command line, NSEC3RSASHA1 will be used by
  176. default. Note that RSASHA256, RSASHA512 and ECCGOST algorithms
  177. are NSEC3-capable.
  178. </para>
  179. </listitem>
  180. </varlistentry>
  181. <varlistentry>
  182. <term>-C</term>
  183. <listitem>
  184. <para>
  185. Compatibility mode: generates an old-style key, without
  186. any metadata. By default, <command>dnssec-keygen</command>
  187. will include the key's creation date in the metadata stored
  188. with the private key, and other dates may be set there as well
  189. (publication date, activation date, etc). Keys that include
  190. this data may be incompatible with older versions of BIND; the
  191. <option>-C</option> option suppresses them.
  192. </para>
  193. </listitem>
  194. </varlistentry>
  195. <varlistentry>
  196. <term>-c <replaceable class="parameter">class</replaceable></term>
  197. <listitem>
  198. <para>
  199. Indicates that the DNS record containing the key should have
  200. the specified class. If not specified, class IN is used.
  201. </para>
  202. </listitem>
  203. </varlistentry>
  204. <varlistentry>
  205. <term>-E <replaceable class="parameter">engine</replaceable></term>
  206. <listitem>
  207. <para>
  208. Uses a crypto hardware (OpenSSL engine) for random number
  209. and, when supported, key generation. When compiled with PKCS#11
  210. support it defaults to pkcs11; the empty name resets it to
  211. no engine.
  212. </para>
  213. </listitem>
  214. </varlistentry>
  215. <varlistentry>
  216. <term>-e</term>
  217. <listitem>
  218. <para>
  219. If generating an RSAMD5/RSASHA1 key, use a large exponent.
  220. </para>
  221. </listitem>
  222. </varlistentry>
  223. <varlistentry>
  224. <term>-f <replaceable class="parameter">flag</replaceable></term>
  225. <listitem>
  226. <para>
  227. Set the specified flag in the flag field of the KEY/DNSKEY record.
  228. The only recognized flags are KSK (Key Signing Key) and REVOKE.
  229. </para>
  230. </listitem>
  231. </varlistentry>
  232. <varlistentry>
  233. <term>-G</term>
  234. <listitem>
  235. <para>
  236. Generate a key, but do not publish it or sign with it. This
  237. option is incompatible with -P and -A.
  238. </para>
  239. </listitem>
  240. </varlistentry>
  241. <varlistentry>
  242. <term>-g <replaceable class="parameter">generator</replaceable></term>
  243. <listitem>
  244. <para>
  245. If generating a Diffie Hellman key, use this generator.
  246. Allowed values are 2 and 5. If no generator
  247. is specified, a known prime from RFC 2539 will be used
  248. if possible; otherwise the default is 2.
  249. </para>
  250. </listitem>
  251. </varlistentry>
  252. <varlistentry>
  253. <term>-h</term>
  254. <listitem>
  255. <para>
  256. Prints a short summary of the options and arguments to
  257. <command>dnssec-keygen</command>.
  258. </para>
  259. </listitem>
  260. </varlistentry>
  261. <varlistentry>
  262. <term>-K <replaceable class="parameter">directory</replaceable></term>
  263. <listitem>
  264. <para>
  265. Sets the directory in which the key files are to be written.
  266. </para>
  267. </listitem>
  268. </varlistentry>
  269. <varlistentry>
  270. <term>-k</term>
  271. <listitem>
  272. <para>
  273. Deprecated in favor of -T KEY.
  274. </para>
  275. </listitem>
  276. </varlistentry>
  277. <varlistentry>
  278. <term>-p <replaceable class="parameter">protocol</replaceable></term>
  279. <listitem>
  280. <para>
  281. Sets the protocol value for the generated key. The protocol
  282. is a number between 0 and 255. The default is 3 (DNSSEC).
  283. Other possible values for this argument are listed in
  284. RFC 2535 and its successors.
  285. </para>
  286. </listitem>
  287. </varlistentry>
  288. <varlistentry>
  289. <term>-q</term>
  290. <listitem>
  291. <para>
  292. Quiet mode: Suppresses unnecessary output, including
  293. progress indication. Without this option, when
  294. <command>dnssec-keygen</command> is run interactively
  295. to generate an RSA or DSA key pair, it will print a string
  296. of symbols to <filename>stderr</filename> indicating the
  297. progress of the key generation. A '.' indicates that a
  298. random number has been found which passed an initial
  299. sieve test; '+' means a number has passed a single
  300. round of the Miller-Rabin primality test; a space
  301. means that the number has passed all the tests and is
  302. a satisfactory key.
  303. </para>
  304. </listitem>
  305. </varlistentry>
  306. <varlistentry>
  307. <term>-r <replaceable class="parameter">randomdev</replaceable></term>
  308. <listitem>
  309. <para>
  310. Specifies the source of randomness. If the operating
  311. system does not provide a <filename>/dev/random</filename>
  312. or equivalent device, the default source of randomness
  313. is keyboard input. <filename>randomdev</filename>
  314. specifies
  315. the name of a character device or file containing random
  316. data to be used instead of the default. The special value
  317. <filename>keyboard</filename> indicates that keyboard
  318. input should be used.
  319. </para>
  320. </listitem>
  321. </varlistentry>
  322. <varlistentry>
  323. <term>-S <replaceable class="parameter">key</replaceable></term>
  324. <listitem>
  325. <para>
  326. Create a new key which is an explicit successor to an
  327. existing key. The name, algorithm, size, and type of the
  328. key will be set to match the existing key. The activation
  329. date of the new key will be set to the inactivation date of
  330. the existing one. The publication date will be set to the
  331. activation date minus the prepublication interval, which
  332. defaults to 30 days.
  333. </para>
  334. </listitem>
  335. </varlistentry>
  336. <varlistentry>
  337. <term>-s <replaceable class="parameter">strength</replaceable></term>
  338. <listitem>
  339. <para>
  340. Specifies the strength value of the key. The strength is
  341. a number between 0 and 15, and currently has no defined
  342. purpose in DNSSEC.
  343. </para>
  344. </listitem>
  345. </varlistentry>
  346. <varlistentry>
  347. <term>-T <replaceable class="parameter">rrtype</replaceable></term>
  348. <listitem>
  349. <para>
  350. Specifies the resource record type to use for the key.
  351. <option>rrtype</option> must be either DNSKEY or KEY. The
  352. default is DNSKEY when using a DNSSEC algorithm, but it can be
  353. overridden to KEY for use with SIG(0).
  354. <para>
  355. </para>
  356. Using any TSIG algorithm (HMAC-* or DH) forces this option
  357. to KEY.
  358. </para>
  359. </listitem>
  360. </varlistentry>
  361. <varlistentry>
  362. <term>-t <replaceable class="parameter">type</replaceable></term>
  363. <listitem>
  364. <para>
  365. Indicates the use of the key. <option>type</option> must be
  366. one of AUTHCONF, NOAUTHCONF, NOAUTH, or NOCONF. The default
  367. is AUTHCONF. AUTH refers to the ability to authenticate
  368. data, and CONF the ability to encrypt data.
  369. </para>
  370. </listitem>
  371. </varlistentry>
  372. <varlistentry>
  373. <term>-v <replaceable class="parameter">level</replaceable></term>
  374. <listitem>
  375. <para>
  376. Sets the debugging level.
  377. </para>
  378. </listitem>
  379. </varlistentry>
  380. </variablelist>
  381. </refsect1>
  382. <refsect1>
  383. <title>TIMING OPTIONS</title>
  384. <para>
  385. Dates can be expressed in the format YYYYMMDD or YYYYMMDDHHMMSS.
  386. If the argument begins with a '+' or '-', it is interpreted as
  387. an offset from the present time. For convenience, if such an offset
  388. is followed by one of the suffixes 'y', 'mo', 'w', 'd', 'h', or 'mi',
  389. then the offset is computed in years (defined as 365 24-hour days,
  390. ignoring leap years), months (defined as 30 24-hour days), weeks,
  391. days, hours, or minutes, respectively. Without a suffix, the offset
  392. is computed in seconds.
  393. </para>
  394. <variablelist>
  395. <varlistentry>
  396. <term>-P <replaceable class="parameter">date/offset</replaceable></term>
  397. <listitem>
  398. <para>
  399. Sets the date on which a key is to be published to the zone.
  400. After that date, the key will be included in the zone but will
  401. not be used to sign it. If not set, and if the -G option has
  402. not been used, the default is "now".
  403. </para>
  404. </listitem>
  405. </varlistentry>
  406. <varlistentry>
  407. <term>-A <replaceable class="parameter">date/offset</replaceable></term>
  408. <listitem>
  409. <para>
  410. Sets the date on which the key is to be activated. After that
  411. date, the key will be included in the zone and used to sign
  412. it. If not set, and if the -G option has not been used, the
  413. default is "now".
  414. </para>
  415. </listitem>
  416. </varlistentry>
  417. <varlistentry>
  418. <term>-R <replaceable class="parameter">date/offset</replaceable></term>
  419. <listitem>
  420. <para>
  421. Sets the date on which the key is to be revoked. After that
  422. date, the key will be flagged as revoked. It will be included
  423. in the zone and will be used to sign it.
  424. </para>
  425. </listitem>
  426. </varlistentry>
  427. <varlistentry>
  428. <term>-I <replaceable class="parameter">date/offset</replaceable></term>
  429. <listitem>
  430. <para>
  431. Sets the date on which the key is to be retired. After that
  432. date, the key will still be included in the zone, but it
  433. will not be used to sign it.
  434. </para>
  435. </listitem>
  436. </varlistentry>
  437. <varlistentry>
  438. <term>-D <replaceable class="parameter">date/offset</replaceable></term>
  439. <listitem>
  440. <para>
  441. Sets the date on which the key is to be deleted. After that
  442. date, the key will no longer be included in the zone. (It
  443. may remain in the key repository, however.)
  444. </para>
  445. </listitem>
  446. </varlistentry>
  447. <varlistentry>
  448. <term>-i <replaceable class="parameter">interval</replaceable></term>
  449. <listitem>
  450. <para>
  451. Sets the prepublication interval for a key. If set, then
  452. the publication and activation dates must be separated by at least
  453. this much time. If the activation date is specified but the
  454. publication date isn't, then the publication date will default
  455. to this much time before the activation date; conversely, if
  456. the publication date is specified but activation date isn't,
  457. then activation will be set to this much time after publication.
  458. </para>
  459. <para>
  460. If the key is being created as an explicit successor to another
  461. key, then the default prepublication interval is 30 days;
  462. otherwise it is zero.
  463. </para>
  464. <para>
  465. As with date offsets, if the argument is followed by one of
  466. the suffixes 'y', 'mo', 'w', 'd', 'h', or 'mi', then the
  467. interval is measured in years, months, weeks, days, hours,
  468. or minutes, respectively. Without a suffix, the interval is
  469. measured in seconds.
  470. </para>
  471. </listitem>
  472. </varlistentry>
  473. </variablelist>
  474. </refsect1>
  475. <refsect1>
  476. <title>GENERATED KEYS</title>
  477. <para>
  478. When <command>dnssec-keygen</command> completes
  479. successfully,
  480. it prints a string of the form <filename>Knnnn.+aaa+iiiii</filename>
  481. to the standard output. This is an identification string for
  482. the key it has generated.
  483. </para>
  484. <itemizedlist>
  485. <listitem>
  486. <para><filename>nnnn</filename> is the key name.
  487. </para>
  488. </listitem>
  489. <listitem>
  490. <para><filename>aaa</filename> is the numeric representation
  491. of the
  492. algorithm.
  493. </para>
  494. </listitem>
  495. <listitem>
  496. <para><filename>iiiii</filename> is the key identifier (or
  497. footprint).
  498. </para>
  499. </listitem>
  500. </itemizedlist>
  501. <para><command>dnssec-keygen</command>
  502. creates two files, with names based
  503. on the printed string. <filename>Knnnn.+aaa+iiiii.key</filename>
  504. contains the public key, and
  505. <filename>Knnnn.+aaa+iiiii.private</filename> contains the
  506. private
  507. key.
  508. </para>
  509. <para>
  510. The <filename>.key</filename> file contains a DNS KEY record
  511. that
  512. can be inserted into a zone file (directly or with a $INCLUDE
  513. statement).
  514. </para>
  515. <para>
  516. The <filename>.private</filename> file contains
  517. algorithm-specific
  518. fields. For obvious security reasons, this file does not have
  519. general read permission.
  520. </para>
  521. <para>
  522. Both <filename>.key</filename> and <filename>.private</filename>
  523. files are generated for symmetric encryption algorithms such as
  524. HMAC-MD5, even though the public and private key are equivalent.
  525. </para>
  526. </refsect1>
  527. <refsect1>
  528. <title>EXAMPLE</title>
  529. <para>
  530. To generate a 768-bit DSA key for the domain
  531. <userinput>example.com</userinput>, the following command would be
  532. issued:
  533. </para>
  534. <para><userinput>dnssec-keygen -a DSA -b 768 -n ZONE example.com</userinput>
  535. </para>
  536. <para>
  537. The command would print a string of the form:
  538. </para>
  539. <para><userinput>Kexample.com.+003+26160</userinput>
  540. </para>
  541. <para>
  542. In this example, <command>dnssec-keygen</command> creates
  543. the files <filename>Kexample.com.+003+26160.key</filename>
  544. and
  545. <filename>Kexample.com.+003+26160.private</filename>.
  546. </para>
  547. </refsect1>
  548. <refsect1>
  549. <title>SEE ALSO</title>
  550. <para><citerefentry>
  551. <refentrytitle>dnssec-signzone</refentrytitle><manvolnum>8</manvolnum>
  552. </citerefentry>,
  553. <citetitle>BIND 9 Administrator Reference Manual</citetitle>,
  554. <citetitle>RFC 2539</citetitle>,
  555. <citetitle>RFC 2845</citetitle>,
  556. <citetitle>RFC 4034</citetitle>.
  557. </para>
  558. </refsect1>
  559. <refsect1>
  560. <title>AUTHOR</title>
  561. <para><corpauthor>Internet Systems Consortium</corpauthor>
  562. </para>
  563. </refsect1>
  564. </refentry><!--
  565. - Local variables:
  566. - mode: sgml
  567. - End:
  568. -->