1310419Sdelphij.Dd November 21 2016
2290001Sglebius.Dt NTP_KEYGEN 8 User Commands
3290001Sglebius.Os
4290001Sglebius.\"  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.mdoc)
5158688Spav.\"
6158688Spav.\" $FreeBSD: releng/9.3/usr.sbin/ntp/doc/ntp-keygen.8 310419 2016-12-22 16:19:05Z delphij $
7158688Spav.\"
8310419Sdelphij.\"  It has been AutoGen-ed  November 21, 2016 at 08:03:48 AM by AutoGen 5.18.5
9290001Sglebius.\"  From the definitions    ntp-keygen-opts.def
10290001Sglebius.\"  and the template file   agmdoc-cmd.tpl
11158688Spav.Sh NAME
12158688Spav.Nm ntp-keygen
13290001Sglebius.Nd Create a NTP host key
14158688Spav.Sh SYNOPSIS
15158688Spav.Nm
16290001Sglebius.\" Mixture of short (flag) options and long options
17290001Sglebius.Op Fl flags
18290001Sglebius.Op Fl flag Op Ar value
19290001Sglebius.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
20290001Sglebius.Pp
21290001SglebiusAll arguments must be options.
22290001Sglebius.Pp
23158688Spav.Sh DESCRIPTION
24158688SpavThis program generates cryptographic data files used by the NTPv4
25158688Spavauthentication and identification schemes.
26158688SpavIt generates MD5 key files used in symmetric key cryptography.
27158688SpavIn addition, if the OpenSSL software library has been installed,
28158688Spavit generates keys, certificate and identity files used in public key
29162893Srucryptography.
30162893SruThese files are used for cookie encryption,
31158688Spavdigital signature and challenge/response identification algorithms
32158688Spavcompatible with the Internet standard security infrastructure.
33158688Spav.Pp
34290001SglebiusAll files are in PEM\-encoded printable ASCII format,
35158688Spavso they can be embedded as MIME attachments in mail to other sites
36158688Spavand certificate authorities.
37162893SruBy default, files are not encrypted.
38290001Sglebius.Pp
39290001SglebiusWhen used to generate message digest keys, the program produces a file
40290001Sglebiuscontaining ten pseudo\-random printable ASCII strings suitable for the
41290001SglebiusMD5 message digest algorithm included in the distribution.
42290001SglebiusIf the OpenSSL library is installed, it produces an additional ten
43290001Sglebiushex\-encoded random bit strings suitable for the SHA1 and other message
44290001Sglebiusdigest algorithms.
45290001SglebiusThe message digest keys file must be distributed and stored
46290001Sglebiususing secure means beyond the scope of NTP itself.
47290001SglebiusBesides the keys used for ordinary NTP associations, additional keys
48290001Sglebiuscan be defined as passwords for the
49290001Sglebius.Xr ntpq 8
50290001Sglebiusand
51290001Sglebius.Xr ntpdc 8
52290001Sglebiusutility programs.
53290001Sglebius.Pp
54290001SglebiusThe remaining generated files are compatible with other OpenSSL
55290001Sglebiusapplications and other Public Key Infrastructure (PKI) resources.
56290001SglebiusCertificates generated by this program are compatible with extant
57290001Sglebiusindustry practice, although some users might find the interpretation of
58290001SglebiusX509v3 extension fields somewhat liberal.
59290001SglebiusHowever, the identity keys are probably not compatible with anything
60290001Sglebiusother than Autokey.
61290001Sglebius.Pp
62290001SglebiusSome files used by this program are encrypted using a private password.
63162893SruThe
64290001Sglebius.Fl p
65290001Sglebiusoption specifies the password for local encrypted files and the
66290001Sglebius.Fl q
67290001Sglebiusoption the password for encrypted files sent to remote sites.
68290001SglebiusIf no password is specified, the host name returned by the Unix
69290001Sglebius.Fn gethostname
70290001Sglebiusfunction, normally the DNS name of the host is used.
71290001Sglebius.Pp
72158688SpavThe
73290001Sglebius.Ar pw
74290001Sglebiusoption of the
75290001Sglebius.Ar crypto
76290001Sglebiusconfiguration command specifies the read
77290001Sglebiuspassword for previously encrypted local files.
78290001SglebiusThis must match the local password used by this program.
79290001SglebiusIf not specified, the host name is used.
80290001SglebiusThus, if files are generated by this program without password,
81290001Sglebiusthey can be read back by
82290001Sglebius.Ar ntpd
83290001Sglebiuswithout password but only on the same host.
84290001Sglebius.Pp
85290001SglebiusNormally, encrypted files for each host are generated by that host and
86290001Sglebiusused only by that host, although exceptions exist as noted later on
87290001Sglebiusthis page.
88290001SglebiusThe symmetric keys file, normally called
89290001Sglebius.Ar ntp.keys ,
90290001Sglebiusis usually installed in
91290001Sglebius.Pa /etc .
92290001SglebiusOther files and links are usually installed in
93290001Sglebius.Pa /usr/local/etc ,
94290001Sglebiuswhich is normally in a shared filesystem in
95290001SglebiusNFS\-mounted networks and cannot be changed by shared clients.
96290001SglebiusThe location of the keys directory can be changed by the
97290001Sglebius.Ar keysdir
98290001Sglebiusconfiguration command in such cases.
99290001SglebiusNormally, this is in
100290001Sglebius.Pa /etc .
101290001Sglebius.Pp
102290001SglebiusThis program directs commentary and error messages to the standard
103290001Sglebiuserror stream
104290001Sglebius.Ar stderr
105290001Sglebiusand remote files to the standard output stream
106290001Sglebius.Ar stdout
107290001Sglebiuswhere they can be piped to other applications or redirected to files.
108290001SglebiusThe names used for generated files and links all begin with the
109290001Sglebiusstring
110290001Sglebius.Ar ntpkey
111290001Sglebiusand include the file type, generating host and filestamp,
112290001Sglebiusas described in the
113290001Sglebius.Dq Cryptographic Data Files
114290001Sglebiussection below.
115290001Sglebius.Ss Running the Program
116290001SglebiusTo test and gain experience with Autokey concepts, log in as root and
117290001Sglebiuschange to the keys directory, usually
118290001Sglebius.Pa /usr/local/etc 
119290001SglebiusWhen run for the first time, or if all files with names beginning with
120290001Sglebius.Ar ntpkey
121290001Sglebiushave been removed, use the
122158688Spav.Nm
123290001Sglebiuscommand without arguments to generate a
124290001Sglebiusdefault RSA host key and matching RSA\-MD5 certificate with expiration
125290001Sglebiusdate one year hence.
126290001SglebiusIf run again without options, the program uses the
127290001Sglebiusexisting keys and parameters and generates only a new certificate with
128290001Sglebiusnew expiration date one year hence.
129158688Spav.Pp
130290001SglebiusRun the command on as many hosts as necessary.
131290001SglebiusDesignate one of them as the trusted host (TH) using
132290001Sglebius.Nm
133290001Sglebiuswith the
134290001Sglebius.Fl T
135290001Sglebiusoption and configure it to synchronize from reliable Internet servers.
136290001SglebiusThen configure the other hosts to synchronize to the TH directly or
137290001Sglebiusindirectly.
138290001SglebiusA certificate trail is created when Autokey asks the immediately
139290001Sglebiusascendant host towards the TH to sign its certificate, which is then
140290001Sglebiusprovided to the immediately descendant host on request.
141290001SglebiusAll group hosts should have acyclic certificate trails ending on the TH.
142290001Sglebius.Pp
143290001SglebiusThe host key is used to encrypt the cookie when required and so must be
144290001SglebiusRSA type.
145290001SglebiusBy default, the host key is also the sign key used to encrypt
146290001Sglebiussignatures.
147290001SglebiusA different sign key can be assigned using the
148290001Sglebius.Fl S
149290001Sglebiusoption and this can be either RSA or DSA type.
150290001SglebiusBy default, the signature
151290001Sglebiusmessage digest type is MD5, but any combination of sign key type and
152290001Sglebiusmessage digest type supported by the OpenSSL library can be specified
153290001Sglebiususing the
154290001Sglebius.Fl c
155290001Sglebiusoption.
156290001SglebiusThe rules say cryptographic media should be generated with proventic
157290001Sglebiusfilestamps, which means the host should already be synchronized before
158290001Sglebiusthis program is run.
159290001SglebiusThis of course creates a chicken\-and\-egg problem
160290001Sglebiuswhen the host is started for the first time.
161290001SglebiusAccordingly, the host time
162290001Sglebiusshould be set by some other means, such as eyeball\-and\-wristwatch, at
163290001Sglebiusleast so that the certificate lifetime is within the current year.
164290001SglebiusAfter that and when the host is synchronized to a proventic source, the
165290001Sglebiuscertificate should be re\-generated.
166290001Sglebius.Pp
167290001SglebiusAdditional information on trusted groups and identity schemes is on the
168290001Sglebius.Dq Autokey Public\-Key Authentication
169290001Sglebiuspage.
170290001Sglebius.Pp
171158688SpavThe
172158688Spav.Xr ntpd 8
173158688Spavconfiguration command
174158688Spav.Ic crypto pw Ar password
175158688Spavspecifies the read password for previously encrypted files.
176158688SpavThe daemon expires on the spot if the password is missing
177158688Spavor incorrect.
178158688SpavFor convenience, if a file has been previously encrypted,
179158688Spavthe default read password is the name of the host running
180158688Spavthe program.
181158688SpavIf the previous write password is specified as the host name,
182158688Spavthese files can be read by that host with no explicit password.
183158688Spav.Pp
184158688SpavFile names begin with the prefix
185158688Spav.Cm ntpkey_
186158688Spavand end with the postfix
187158688Spav.Ar _hostname.filestamp ,
188158688Spavwhere
189158688Spav.Ar hostname
190158688Spavis the owner name, usually the string returned
191158688Spavby the Unix gethostname() routine, and
192158688Spav.Ar filestamp
193158688Spavis the NTP seconds when the file was generated, in decimal digits.
194158688SpavThis both guarantees uniqueness and simplifies maintenance
195158688Spavprocedures, since all files can be quickly removed
196158688Spavby a
197158688Spav.Ic rm ntpkey\&*
198158688Spavcommand or all files generated
199158688Spavat a specific time can be removed by a
200158688Spav.Ic rm
201158688Spav.Ar \&*filestamp
202158688Spavcommand.
203158688SpavTo further reduce the risk of misconfiguration,
204158688Spavthe first two lines of a file contain the file name
205158688Spavand generation date and time as comments.
206158688Spav.Pp
207158688SpavAll files are installed by default in the keys directory
208158688Spav.Pa /usr/local/etc ,
209158688Spavwhich is normally in a shared filesystem
210290001Sglebiusin NFS\-mounted networks.
211162893SruThe actual location of the keys directory
212158688Spavand each file can be overridden by configuration commands,
213158688Spavbut this is not recommended.
214158688SpavNormally, the files for each host are generated by that host
215158688Spavand used only by that host, although exceptions exist
216158688Spavas noted later on this page.
217158688Spav.Pp
218158688SpavNormally, files containing private values,
219158688Spavincluding the host key, sign key and identification parameters,
220290001Sglebiusare permitted root read/write\-only;
221158688Spavwhile others containing public values are permitted world readable.
222158688SpavAlternatively, files containing private values can be encrypted
223158688Spavand these files permitted world readable,
224158688Spavwhich simplifies maintenance in shared file systems.
225158688SpavSince uniqueness is insured by the hostname and
226158688Spavfile name extensions, the files for a NFS server and
227158688Spavdependent clients can all be installed in the same shared directory.
228158688Spav.Pp
229158688SpavThe recommended practice is to keep the file name extensions
230158688Spavwhen installing a file and to install a soft link
231158688Spavfrom the generic names specified elsewhere on this page
232158688Spavto the generated files.
233158688SpavThis allows new file generations to be activated simply
234158688Spavby changing the link.
235158688SpavIf a link is present, ntpd follows it to the file name
236158688Spavto extract the filestamp.
237158688SpavIf a link is not present,
238158688Spav.Xr ntpd 8
239158688Spavextracts the filestamp from the file itself.
240158688SpavThis allows clients to verify that the file and generation times
241162893Sruare always current.
242162893SruThe
243158688Spav.Nm
244158688Spavprogram uses the same timestamp extension for all files generated
245158688Spavat one time, so each generation is distinct and can be readily
246158688Spavrecognized in monitoring data.
247158688Spav.Ss Running the program
248158688SpavThe safest way to run the
249158688Spav.Nm
250158688Spavprogram is logged in directly as root.
251158688SpavThe recommended procedure is change to the keys directory,
252158688Spavusually
253185072Sdanger.Pa /usr/local/etc ,
254162893Sruthen run the program.
255162893SruWhen run for the first time,
256158688Spavor if all
257158688Spav.Cm ntpkey
258158688Spavfiles have been removed,
259290001Sglebiusthe program generates a RSA host key file and matching RSA\-MD5 certificate file,
260158688Spavwhich is all that is necessary in many cases.
261158688SpavThe program also generates soft links from the generic names
262158688Spavto the respective files.
263158688SpavIf run again, the program uses the same host key file,
264158688Spavbut generates a new certificate file and link.
265158688Spav.Pp
266158688SpavThe host key is used to encrypt the cookie when required and so must be RSA type.
267158688SpavBy default, the host key is also the sign key used to encrypt signatures.
268158688SpavWhen necessary, a different sign key can be specified and this can be
269158688Spaveither RSA or DSA type.
270158688SpavBy default, the message digest type is MD5, but any combination
271158688Spavof sign key type and message digest type supported by the OpenSSL library
272158688Spavcan be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
273158688Spavand RIPE160 message digest algorithms.
274158688SpavHowever, the scheme specified in the certificate must be compatible
275158688Spavwith the sign key.
276158688SpavCertificates using any digest algorithm are compatible with RSA sign keys;
277158688Spavhowever, only SHA and SHA1 certificates are compatible with DSA sign keys.
278158688Spav.Pp
279158688SpavPrivate/public key files and certificates are compatible with
280158688Spavother OpenSSL applications and very likely other libraries as well.
281158688SpavCertificates or certificate requests derived from them should be compatible
282158688Spavwith extant industry practice, although some users might find
283158688Spavthe interpretation of X509v3 extension fields somewhat liberal.
284158688SpavHowever, the identification parameter files, although encoded
285158688Spavas the other files, are probably not compatible with anything other than Autokey.
286158688Spav.Pp
287158688SpavRunning the program as other than root and using the Unix
288158688Spav.Ic su
289158688Spavcommand
290158688Spavto assume root may not work properly, since by default the OpenSSL library
291158688Spavlooks for the random seed file
292158688Spav.Cm .rnd
293158688Spavin the user home directory.
294158688SpavHowever, there should be only one
295158688Spav.Cm .rnd ,
296158688Spavmost conveniently
297158688Spavin the root directory, so it is convenient to define the
298158688Spav.Cm $RANDFILE
299158688Spavenvironment variable used by the OpenSSL library as the path to
300158688Spav.Cm /.rnd .
301158688Spav.Pp
302290001SglebiusInstalling the keys as root might not work in NFS\-mounted
303158688Spavshared file systems, as NFS clients may not be able to write
304158688Spavto the shared keys directory, even as root.
305158688SpavIn this case, NFS clients can specify the files in another
306158688Spavdirectory such as
307158688Spav.Pa /etc
308158688Spavusing the
309158688Spav.Ic keysdir
310158688Spavcommand.
311158688SpavThere is no need for one client to read the keys and certificates
312158688Spavof other clients or servers, as these data are obtained automatically
313158688Spavby the Autokey protocol.
314158688Spav.Pp
315158688SpavOrdinarily, cryptographic files are generated by the host that uses them,
316158688Spavbut it is possible for a trusted agent (TA) to generate these files
317158688Spavfor other hosts; however, in such cases files should always be encrypted.
318158688SpavThe subject name and trusted name default to the hostname
319158688Spavof the host generating the files, but can be changed by command line options.
320158688SpavIt is convenient to designate the owner name and trusted name
321158688Spavas the subject and issuer fields, respectively, of the certificate.
322158688SpavThe owner name is also used for the host and sign key files,
323158688Spavwhile the trusted name is used for the identity files.
324158688Spav.Pp
325290001SglebiusAll files are installed by default in the keys directory
326290001Sglebius.Pa /usr/local/etc ,
327290001Sglebiuswhich is normally in a shared filesystem
328290001Sglebiusin NFS\-mounted networks.
329290001SglebiusThe actual location of the keys directory
330290001Sglebiusand each file can be overridden by configuration commands,
331290001Sglebiusbut this is not recommended.
332290001SglebiusNormally, the files for each host are generated by that host
333290001Sglebiusand used only by that host, although exceptions exist
334290001Sglebiusas noted later on this page.
335290001Sglebius.Pp
336290001SglebiusNormally, files containing private values,
337290001Sglebiusincluding the host key, sign key and identification parameters,
338290001Sglebiusare permitted root read/write\-only;
339290001Sglebiuswhile others containing public values are permitted world readable.
340290001SglebiusAlternatively, files containing private values can be encrypted
341290001Sglebiusand these files permitted world readable,
342290001Sglebiuswhich simplifies maintenance in shared file systems.
343290001SglebiusSince uniqueness is insured by the hostname and
344290001Sglebiusfile name extensions, the files for a NFS server and
345290001Sglebiusdependent clients can all be installed in the same shared directory.
346290001Sglebius.Pp
347290001SglebiusThe recommended practice is to keep the file name extensions
348290001Sglebiuswhen installing a file and to install a soft link
349290001Sglebiusfrom the generic names specified elsewhere on this page
350290001Sglebiusto the generated files.
351290001SglebiusThis allows new file generations to be activated simply
352290001Sglebiusby changing the link.
353290001SglebiusIf a link is present, ntpd follows it to the file name
354290001Sglebiusto extract the filestamp.
355290001SglebiusIf a link is not present,
356290001Sglebius.Xr ntpd 8
357290001Sglebiusextracts the filestamp from the file itself.
358290001SglebiusThis allows clients to verify that the file and generation times
359290001Sglebiusare always current.
360290001SglebiusThe
361290001Sglebius.Nm
362290001Sglebiusprogram uses the same timestamp extension for all files generated
363290001Sglebiusat one time, so each generation is distinct and can be readily
364290001Sglebiusrecognized in monitoring data.
365290001Sglebius.Ss Running the program
366290001SglebiusThe safest way to run the
367290001Sglebius.Nm
368290001Sglebiusprogram is logged in directly as root.
369290001SglebiusThe recommended procedure is change to the keys directory,
370290001Sglebiususually
371290001Sglebius.Pa /usr/local/etc ,
372290001Sglebiusthen run the program.
373290001SglebiusWhen run for the first time,
374290001Sglebiusor if all
375290001Sglebius.Cm ntpkey
376290001Sglebiusfiles have been removed,
377290001Sglebiusthe program generates a RSA host key file and matching RSA\-MD5 certificate file,
378290001Sglebiuswhich is all that is necessary in many cases.
379290001SglebiusThe program also generates soft links from the generic names
380290001Sglebiusto the respective files.
381290001SglebiusIf run again, the program uses the same host key file,
382290001Sglebiusbut generates a new certificate file and link.
383290001Sglebius.Pp
384290001SglebiusThe host key is used to encrypt the cookie when required and so must be RSA type.
385290001SglebiusBy default, the host key is also the sign key used to encrypt signatures.
386290001SglebiusWhen necessary, a different sign key can be specified and this can be
387290001Sglebiuseither RSA or DSA type.
388290001SglebiusBy default, the message digest type is MD5, but any combination
389290001Sglebiusof sign key type and message digest type supported by the OpenSSL library
390290001Sglebiuscan be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
391290001Sglebiusand RIPE160 message digest algorithms.
392290001SglebiusHowever, the scheme specified in the certificate must be compatible
393290001Sglebiuswith the sign key.
394290001SglebiusCertificates using any digest algorithm are compatible with RSA sign keys;
395290001Sglebiushowever, only SHA and SHA1 certificates are compatible with DSA sign keys.
396290001Sglebius.Pp
397290001SglebiusPrivate/public key files and certificates are compatible with
398290001Sglebiusother OpenSSL applications and very likely other libraries as well.
399290001SglebiusCertificates or certificate requests derived from them should be compatible
400290001Sglebiuswith extant industry practice, although some users might find
401290001Sglebiusthe interpretation of X509v3 extension fields somewhat liberal.
402290001SglebiusHowever, the identification parameter files, although encoded
403290001Sglebiusas the other files, are probably not compatible with anything other than Autokey.
404290001Sglebius.Pp
405290001SglebiusRunning the program as other than root and using the Unix
406290001Sglebius.Ic su
407290001Sglebiuscommand
408290001Sglebiusto assume root may not work properly, since by default the OpenSSL library
409290001Sglebiuslooks for the random seed file
410290001Sglebius.Cm .rnd
411290001Sglebiusin the user home directory.
412290001SglebiusHowever, there should be only one
413290001Sglebius.Cm .rnd ,
414290001Sglebiusmost conveniently
415290001Sglebiusin the root directory, so it is convenient to define the
416290001Sglebius.Cm $RANDFILE
417290001Sglebiusenvironment variable used by the OpenSSL library as the path to
418290001Sglebius.Cm /.rnd .
419290001Sglebius.Pp
420290001SglebiusInstalling the keys as root might not work in NFS\-mounted
421290001Sglebiusshared file systems, as NFS clients may not be able to write
422290001Sglebiusto the shared keys directory, even as root.
423290001SglebiusIn this case, NFS clients can specify the files in another
424290001Sglebiusdirectory such as
425290001Sglebius.Pa /etc
426290001Sglebiususing the
427290001Sglebius.Ic keysdir
428290001Sglebiuscommand.
429290001SglebiusThere is no need for one client to read the keys and certificates
430290001Sglebiusof other clients or servers, as these data are obtained automatically
431290001Sglebiusby the Autokey protocol.
432290001Sglebius.Pp
433290001SglebiusOrdinarily, cryptographic files are generated by the host that uses them,
434290001Sglebiusbut it is possible for a trusted agent (TA) to generate these files
435290001Sglebiusfor other hosts; however, in such cases files should always be encrypted.
436290001SglebiusThe subject name and trusted name default to the hostname
437290001Sglebiusof the host generating the files, but can be changed by command line options.
438290001SglebiusIt is convenient to designate the owner name and trusted name
439290001Sglebiusas the subject and issuer fields, respectively, of the certificate.
440290001SglebiusThe owner name is also used for the host and sign key files,
441290001Sglebiuswhile the trusted name is used for the identity files.
442290001Sglebiusseconds.
443290001Sglebiusseconds.
444290001Sglebiuss Trusted Hosts and Groups
445158688SpavEach cryptographic configuration involves selection of a signature scheme
446158688Spavand identification scheme, called a cryptotype,
447158688Spavas explained in the
448158688Spav.Sx Authentication Options
449158688Spavsection of
450158688Spav.Xr ntp.conf 5 .
451158688SpavThe default cryptotype uses RSA encryption, MD5 message digest
452158688Spavand TC identification.
453290001SglebiusFirst, configure a NTP subnet including one or more low\-stratum
454158688Spavtrusted hosts from which all other hosts derive synchronization
455162893Srudirectly or indirectly.
456162893SruTrusted hosts have trusted certificates;
457158688Spavall other hosts have nontrusted certificates.
458158688SpavThese hosts will automatically and dynamically build authoritative
459158688Spavcertificate trails to one or more trusted hosts.
460158688SpavA trusted group is the set of all hosts that have, directly or indirectly,
461158688Spava certificate trail ending at a trusted host.
462158688SpavThe trail is defined by static configuration file entries
463158688Spavor dynamic means described on the
464158688Spav.Sx Automatic NTP Configuration Options
465158688Spavsection of
466158688Spav.Xr ntp.conf 5 .
467158688Spav.Pp
468158688SpavOn each trusted host as root, change to the keys directory.
469158688SpavTo insure a fresh fileset, remove all
470158688Spav.Cm ntpkey
471158688Spavfiles.
472158688SpavThen run
473158688Spav.Nm
474158688Spav.Fl T
475158688Spavto generate keys and a trusted certificate.
476158688SpavOn all other hosts do the same, but leave off the
477158688Spav.Fl T
478158688Spavflag to generate keys and nontrusted certificates.
479158688SpavWhen complete, start the NTP daemons beginning at the lowest stratum
480158688Spavand working up the tree.
481158688SpavIt may take some time for Autokey to instantiate the certificate trails
482158688Spavthroughout the subnet, but setting up the environment is completely automatic.
483158688Spav.Pp
484158688SpavIf it is necessary to use a different sign key or different digest/signature
485158688Spavscheme than the default, run
486158688Spav.Nm
487158688Spavwith the
488158688Spav.Fl S Ar type
489158688Spavoption, where
490158688Spav.Ar type
491158688Spavis either
492158688Spav.Cm RSA
493158688Spavor
494158688Spav.Cm DSA .
495290001SglebiusThe most often need to do this is when a DSA\-signed certificate is used.
496158688SpavIf it is necessary to use a different certificate scheme than the default,
497158688Spavrun
498158688Spav.Nm
499158688Spavwith the
500158688Spav.Fl c Ar scheme
501158688Spavoption and selected
502158688Spav.Ar scheme
503158688Spavas needed.
504290001Sglebiusf
505158688Spav.Nm
506158688Spavis run again without these options, it generates a new certificate
507158688Spavusing the same scheme and sign key.
508158688Spav.Pp
509158688SpavAfter setting up the environment it is advisable to update certificates
510158688Spavfrom time to time, if only to extend the validity interval.
511158688SpavSimply run
512158688Spav.Nm
513158688Spavwith the same flags as before to generate new certificates
514158688Spavusing existing keys.
515158688SpavHowever, if the host or sign key is changed,
516158688Spav.Xr ntpd 8
517158688Spavshould be restarted.
518158688SpavWhen
519158688Spav.Xr ntpd 8
520158688Spavis restarted, it loads any new files and restarts the protocol.
521158688SpavOther dependent hosts will continue as usual until signatures are refreshed,
522158688Spavat which time the protocol is restarted.
523158688Spav.Ss Identity Schemes
524158688SpavAs mentioned on the Autonomous Authentication page,
525158688Spavthe default TC identity scheme is vulnerable to a middleman attack.
526158688SpavHowever, there are more secure identity schemes available,
527158688Spavincluding PC, IFF, GQ and MV described on the
528158688Spav.Qq Identification Schemes
529158688Spavpage
530158688Spav(maybe available at
531158688Spav.Li http://www.eecis.udel.edu/%7emills/keygen.html ) .
532158688SpavThese schemes are based on a TA, one or more trusted hosts
533158688Spavand some number of nontrusted hosts.
534158688SpavTrusted hosts prove identity using values provided by the TA,
535158688Spavwhile the remaining hosts prove identity using values provided
536158688Spavby a trusted host and certificate trails that end on that host.
537158688SpavThe name of a trusted host is also the name of its sugroup
538158688Spavand also the subject and issuer name on its trusted certificate.
539158688SpavThe TA is not necessarily a trusted host in this sense, but often is.
540158688Spav.Pp
541158688SpavIn some schemes there are separate keys for servers and clients.
542158688SpavA server can also be a client of another server,
543158688Spavbut a client can never be a server for another client.
544158688SpavIn general, trusted hosts and nontrusted hosts that operate
545158688Spavas both server and client have parameter files that contain
546162893Sruboth server and client keys.
547162893SruHosts that operate
548158688Spavonly as clients have key files that contain only client keys.
549158688Spav.Pp
550158688SpavThe PC scheme supports only one trusted host in the group.
551158688SpavOn trusted host alice run
552158688Spav.Nm
553158688Spav.Fl P
554158688Spav.Fl p Ar password
555158688Spavto generate the host key file
556158688Spav.Pa ntpkey_RSAkey_ Ns Ar alice.filestamp
557158688Spavand trusted private certificate file
558290001Sglebius.Pa ntpkey_RSA\-MD5_cert_ Ns Ar alice.filestamp .
559158688SpavCopy both files to all group hosts;
560158688Spavthey replace the files which would be generated in other schemes.
561158688SpavOn each host bob install a soft link from the generic name
562158688Spav.Pa ntpkey_host_ Ns Ar bob
563158688Spavto the host key file and soft link
564158688Spav.Pa ntpkey_cert_ Ns Ar bob
565158688Spavto the private certificate file.
566158688SpavNote the generic links are on bob, but point to files generated
567162893Sruby trusted host alice.
568162893SruIn this scheme it is not possible to refresh
569158688Spaveither the keys or certificates without copying them
570158688Spavto all other hosts in the group.
571158688Spav.Pp
572158688SpavFor the IFF scheme proceed as in the TC scheme to generate keys
573158688Spavand certificates for all group hosts, then for every trusted host in the group,
574158688Spavgenerate the IFF parameter file.
575158688SpavOn trusted host alice run
576158688Spav.Nm
577158688Spav.Fl T
578158688Spav.Fl I
579158688Spav.Fl p Ar password
580158688Spavto produce her parameter file
581158688Spav.Pa ntpkey_IFFpar_ Ns Ar alice.filestamp ,
582158688Spavwhich includes both server and client keys.
583158688SpavCopy this file to all group hosts that operate as both servers
584158688Spavand clients and install a soft link from the generic
585158688Spav.Pa ntpkey_iff_ Ns Ar alice
586158688Spavto this file.
587158688SpavIf there are no hosts restricted to operate only as clients,
588162893Sruthere is nothing further to do.
589162893SruAs the IFF scheme is independent
590158688Spavof keys and certificates, these files can be refreshed as needed.
591158688Spav.Pp
592158688SpavIf a rogue client has the parameter file, it could masquerade
593158688Spavas a legitimate server and present a middleman threat.
594158688SpavTo eliminate this threat, the client keys can be extracted
595158688Spavfrom the parameter file and distributed to all restricted clients.
596158688SpavAfter generating the parameter file, on alice run
597158688Spav.Nm
598158688Spav.Fl e
599158688Spavand pipe the output to a file or mail program.
600158688SpavCopy or mail this file to all restricted clients.
601158688SpavOn these clients install a soft link from the generic
602158688Spav.Pa ntpkey_iff_ Ns Ar alice
603162893Sruto this file.
604162893SruTo further protect the integrity of the keys,
605158688Spaveach file can be encrypted with a secret password.
606158688Spav.Pp
607158688SpavFor the GQ scheme proceed as in the TC scheme to generate keys
608158688Spavand certificates for all group hosts, then for every trusted host
609158688Spavin the group, generate the IFF parameter file.
610158688SpavOn trusted host alice run
611158688Spav.Nm
612158688Spav.Fl T
613158688Spav.Fl G
614158688Spav.Fl p Ar password
615158688Spavto produce her parameter file
616158688Spav.Pa ntpkey_GQpar_ Ns Ar alice.filestamp ,
617158688Spavwhich includes both server and client keys.
618158688SpavCopy this file to all group hosts and install a soft link
619158688Spavfrom the generic
620158688Spav.Pa ntpkey_gq_ Ns Ar alice
621158688Spavto this file.
622158688SpavIn addition, on each host bob install a soft link
623158688Spavfrom generic
624158688Spav.Pa ntpkey_gq_ Ns Ar bob
625158688Spavto this file.
626158688SpavAs the GQ scheme updates the GQ parameters file and certificate
627158688Spavat the same time, keys and certificates can be regenerated as needed.
628158688Spav.Pp
629158688SpavFor the MV scheme, proceed as in the TC scheme to generate keys
630158688Spavand certificates for all group hosts.
631158688SpavFor illustration assume trish is the TA, alice one of several trusted hosts
632162893Sruand bob one of her clients.
633162893SruOn TA trish run
634158688Spav.Nm
635158688Spav.Fl V Ar n
636158688Spav.Fl p Ar password ,
637158688Spavwhere
638158688Spav.Ar n
639158688Spavis the number of revokable keys (typically 5) to produce
640158688Spavthe parameter file
641158688Spav.Pa ntpkeys_MVpar_ Ns Ar trish.filestamp
642158688Spavand client key files
643158688Spav.Pa ntpkeys_MVkeyd_ Ns Ar trish.filestamp
644158688Spavwhere
645158688Spav.Ar d
646158688Spavis the key number (0 \&<
647158688Spav.Ar d
648158688Spav\&<
649158688Spav.Ar n ) .
650158688SpavCopy the parameter file to alice and install a soft link
651158688Spavfrom the generic
652158688Spav.Pa ntpkey_mv_ Ns Ar alice
653158688Spavto this file.
654158688SpavCopy one of the client key files to alice for later distribution
655158688Spavto her clients.
656158688SpavIt doesn't matter which client key file goes to alice,
657158688Spavsince they all work the same way.
658158688SpavAlice copies the client key file to all of her cliens.
659158688SpavOn client bob install a soft link from generic
660158688Spav.Pa ntpkey_mvkey_ Ns Ar bob
661158688Spavto the client key file.
662158688SpavAs the MV scheme is independent of keys and certificates,
663158688Spavthese files can be refreshed as needed.
664158688Spav.Ss Command Line Options
665158688Spav.Bl -tag -width indent
666162893Sru.It Fl c Ar scheme
667158688SpavSelect certificate message digest/signature encryption scheme.
668162893SruThe
669162893Sru.Ar scheme
670162893Srucan be one of the following:
671290001Sglebius. Cm RSA\-MD2 , RSA\-MD5 , RSA\-SHA , RSA\-SHA1 , RSA\-MDC2 , RSA\-RIPEMD160 , DSA\-SHA ,
672162893Sruor
673290001Sglebius.Cm DSA\-SHA1 .
674158688SpavNote that RSA schemes must be used with a RSA sign key and DSA
675158688Spavschemes must be used with a DSA sign key.
676158688SpavThe default without this option is
677290001Sglebius.Cm RSA\-MD5 .
678158688Spav.It Fl d
679158688SpavEnable debugging.
680290001SglebiusThis option displays the cryptographic data produced in eye\-friendly billboards.
681158688Spav.It Fl e
682158688SpavWrite the IFF client keys to the standard output.
683158688SpavThis is intended for automatic key distribution by mail.
684158688Spav.It Fl G
685158688SpavGenerate parameters and keys for the GQ identification scheme,
686158688Spavobsoleting any that may exist.
687158688Spav.It Fl g
688158688SpavGenerate keys for the GQ identification scheme
689158688Spavusing the existing GQ parameters.
690158688SpavIf the GQ parameters do not yet exist, create them first.
691158688Spav.It Fl H
692158688SpavGenerate new host keys, obsoleting any that may exist.
693158688Spav.It Fl I
694158688SpavGenerate parameters for the IFF identification scheme,
695158688Spavobsoleting any that may exist.
696158688Spav.It Fl i Ar name
697158688SpavSet the suject name to
698158688Spav.Ar name .
699158688SpavThis is used as the subject field in certificates
700158688Spavand in the file name for host and sign keys.
701158688Spav.It Fl M
702158688SpavGenerate MD5 keys, obsoleting any that may exist.
703158688Spav.It Fl P
704158688SpavGenerate a private certificate.
705158688SpavBy default, the program generates public certificates.
706158688Spav.It Fl p Ar password
707158688SpavEncrypt generated files containing private data with
708158688Spav.Ar password
709290001Sglebiusand the DES\-CBC algorithm.
710158688Spav.It Fl q
711158688SpavSet the password for reading files to password.
712158688Spav.It Fl S Oo Cm RSA | DSA Oc
713158688SpavGenerate a new sign key of the designated type,
714158688Spavobsoleting any that may exist.
715158688SpavBy default, the program uses the host key as the sign key.
716158688Spav.It Fl s Ar name
717158688SpavSet the issuer name to
718158688Spav.Ar name .
719158688SpavThis is used for the issuer field in certificates
720158688Spavand in the file name for identity files.
721158688Spav.It Fl T
722158688SpavGenerate a trusted certificate.
723290001SglebiusBy default, the program generates a non\-trusted certificate.
724158688Spav.It Fl V Ar nkeys
725290001SglebiusGenerate parameters and keys for the Mu\-Varadharajan (MV) identification scheme.
726158688Spav.El
727158688Spav.Ss Random Seed File
728158688SpavAll cryptographically sound key generation schemes must have means
729158688Spavto randomize the entropy seed used to initialize
730290001Sglebiusthe internal pseudo\-random number generator used
731158688Spavby the library routines.
732158688SpavThe OpenSSL library uses a designated random seed file for this purpose.
733158688SpavThe file must be available when starting the NTP daemon and
734158688Spav.Nm
735162893Sruprogram.
736162893SruIf a site supports OpenSSL or its companion OpenSSH,
737158688Spavit is very likely that means to do this are already available.
738158688Spav.Pp
739158688SpavIt is important to understand that entropy must be evolved
740158688Spavfor each generation, for otherwise the random number sequence
741158688Spavwould be predictable.
742158688SpavVarious means dependent on external events, such as keystroke intervals,
743290001Sglebiuscan be used to do this and some systems have built\-in entropy sources.
744158688SpavSuitable means are described in the OpenSSL software documentation,
745158688Spavbut are outside the scope of this page.
746158688Spav.Pp
747158688SpavThe entropy seed used by the OpenSSL library is contained in a file,
748158688Spavusually called
749158688Spav.Cm .rnd ,
750158688Spavwhich must be available when starting the NTP daemon
751158688Spavor the
752158688Spav.Nm
753162893Sruprogram.
754162893SruThe NTP daemon will first look for the file
755158688Spavusing the path specified by the
756158688Spav.Ic randfile
757158688Spavsubcommand of the
758158688Spav.Ic crypto
759158688Spavconfiguration command.
760158688SpavIf not specified in this way, or when starting the
761158688Spav.Nm
762158688Spavprogram,
763158688Spavthe OpenSSL library will look for the file using the path specified
764158688Spavby the
765158688Spav.Ev RANDFILE
766158688Spavenvironment variable in the user home directory,
767158688Spavwhether root or some other user.
768158688SpavIf the
769158688Spav.Ev RANDFILE
770158688Spavenvironment variable is not present,
771158688Spavthe library will look for the
772158688Spav.Cm .rnd
773158688Spavfile in the user home directory.
774158688SpavIf the file is not available or cannot be written,
775158688Spavthe daemon exits with a message to the system log and the program
776158688Spavexits with a suitable error message.
777158688Spav.Ss Cryptographic Data Files
778158688SpavAll other file formats begin with two lines.
779158688SpavThe first contains the file name, including the generated host name
780158688Spavand filestamp.
781158688SpavThe second contains the datestamp in conventional Unix date format.
782158688SpavLines beginning with # are considered comments and ignored by the
783158688Spav.Nm
784158688Spavprogram and
785158688Spav.Xr ntpd 8
786158688Spavdaemon.
787158688SpavCryptographic values are encoded first using ASN.1 rules,
788290001Sglebiusthen encrypted if necessary, and finally written PEM\-encoded
789158688Spavprintable ASCII format preceded and followed by MIME content identifier lines.
790158688Spav.Pp
791158688SpavThe format of the symmetric keys file is somewhat different
792158688Spavthan the other files in the interest of backward compatibility.
793290001SglebiusSince DES\-CBC is deprecated in NTPv4, the only key format of interest
794162893Sruis MD5 alphanumeric strings.
795162893SruFollowing hte heard the keys are
796158688Spaventered one per line in the format
797158688Spav.D1 Ar keyno type key
798158688Spavwhere
799158688Spav.Ar keyno
800290001Sglebiusis a positive integer in the range 1\-65,535,
801158688Spav.Ar type
802158688Spavis the string MD5 defining the key format and
803158688Spav.Ar key
804158688Spavis the key itself,
805158688Spavwhich is a printable ASCII string 16 characters or less in length.
806158688SpavEach character is chosen from the 93 printable characters
807158688Spavin the range 0x21 through 0x7f excluding space and the
808158688Spav.Ql #
809158688Spavcharacter.
810158688Spav.Pp
811158688SpavNote that the keys used by the
812158688Spav.Xr ntpq 8
813158688Spavand
814158688Spav.Xr ntpdc 8
815158688Spavprograms
816158688Spavare checked against passwords requested by the programs
817158688Spavand entered by hand, so it is generally appropriate to specify these keys
818158688Spavin human readable ASCII format.
819158688Spav.Pp
820158688SpavThe
821158688Spav.Nm
822158688Spavprogram generates a MD5 symmetric keys file
823158688Spav.Pa ntpkey_MD5key_ Ns Ar hostname.filestamp .
824158688SpavSince the file contains private shared keys,
825158688Spavit should be visible only to root and distributed by secure means
826158688Spavto other subnet hosts.
827158688SpavThe NTP daemon loads the file
828158688Spav.Pa ntp.keys ,
829158688Spavso
830158688Spav.Nm
831158688Spavinstalls a soft link from this name to the generated file.
832158688SpavSubsequently, similar soft links must be installed by manual
833158688Spavor automated means on the other subnet hosts.
834158688SpavWhile this file is not used with the Autokey Version 2 protocol,
835158688Spavit is needed to authenticate some remote configuration commands
836158688Spavused by the
837158688Spav.Xr ntpq 8
838158688Spavand
839158688Spav.Xr ntpdc 8
840158688Spavutilities.
841290001Sglebius.Sh "OPTIONS"
842290001Sglebius.Bl -tag
843290001Sglebius.It  Fl b Ar imbits , Fl \-imbits Ns = Ns Ar imbits 
844290001Sglebiusidentity modulus bits.
845290001SglebiusThis option takes an integer number as its argument.
846290001SglebiusThe value of
847290001Sglebius.Ar imbits
848290001Sglebiusis constrained to being:
849290001Sglebius.in +4
850290001Sglebius.nf
851290001Sglebius.na
852290001Sglebiusin the range  256 through 2048
853290001Sglebius.fi
854290001Sglebius.in -4
855290001Sglebius.sp
856290001SglebiusThe number of bits in the identity modulus.  The default is 256.
857290001Sglebius.It  Fl c Ar scheme , Fl \-certificate Ns = Ns Ar scheme 
858290001Sglebiuscertificate scheme.
859290001Sglebius.sp
860290001Sglebiusscheme is one of
861290001SglebiusRSA\-MD2, RSA\-MD5, RSA\-SHA, RSA\-SHA1, RSA\-MDC2, RSA\-RIPEMD160,
862290001SglebiusDSA\-SHA, or DSA\-SHA1.
863290001Sglebius.sp
864290001SglebiusSelect the certificate message digest/signature encryption scheme.
865290001SglebiusNote that RSA schemes must be used with a RSA sign key and DSA
866290001Sglebiusschemes must be used with a DSA sign key.  The default without
867290001Sglebiusthis option is RSA\-MD5.
868290001Sglebius.It  Fl C Ar cipher , Fl \-cipher Ns = Ns Ar cipher 
869290001Sglebiusprivatekey cipher.
870290001Sglebius.sp
871290001SglebiusSelect the cipher which is used to encrypt the files containing
872290001Sglebiusprivate keys.  The default is three\-key triple DES in CBC mode,
873290001Sglebiusequivalent to "@code{\-C des\-ede3\-cbc".  The openssl tool lists ciphers
874290001Sglebiusavailable in "\fBopenssl \-h\fP" output.
875290001Sglebius.It  Fl d , Fl \-debug\-level 
876290001SglebiusIncrease debug verbosity level.
877290001SglebiusThis option may appear an unlimited number of times.
878290001Sglebius.sp
879290001Sglebius.It  Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number 
880290001SglebiusSet the debug verbosity level.
881290001SglebiusThis option may appear an unlimited number of times.
882290001SglebiusThis option takes an integer number as its argument.
883290001Sglebius.sp
884290001Sglebius.It  Fl e , Fl \-id\-key 
885290001SglebiusWrite IFF or GQ identity keys.
886290001Sglebius.sp
887290001SglebiusWrite the IFF or GQ client keys to the standard output.  This is
888290001Sglebiusintended for automatic key distribution by mail.
889290001Sglebius.It  Fl G , Fl \-gq\-params 
890290001SglebiusGenerate GQ parameters and keys.
891290001Sglebius.sp
892290001SglebiusGenerate parameters and keys for the GQ identification scheme,
893290001Sglebiusobsoleting any that may exist.
894290001Sglebius.It  Fl H , Fl \-host\-key 
895290001Sglebiusgenerate RSA host key.
896290001Sglebius.sp
897290001SglebiusGenerate new host keys, obsoleting any that may exist.
898290001Sglebius.It  Fl I , Fl \-iffkey 
899290001Sglebiusgenerate IFF parameters.
900290001Sglebius.sp
901290001SglebiusGenerate parameters for the IFF identification scheme, obsoleting
902290001Sglebiusany that may exist.
903290001Sglebius.It  Fl i Ar group , Fl \-ident Ns = Ns Ar group 
904290001Sglebiusset Autokey group name.
905290001Sglebius.sp
906290001SglebiusSet the optional Autokey group name to name.  This is used in
907290001Sglebiusthe file name of IFF, GQ, and MV client parameters files.  In
908290001Sglebiusthat role, the default is the host name if this option is not
909290001Sglebiusprovided.  The group name, if specified using \fB\-i/\-\-ident\fP or
910290001Sglebiususing \fB\-s/\-\-subject\-name\fP following an '\fB@\fP' character,
911290001Sglebiusis also a part of the self\-signed host certificate's subject and
912290001Sglebiusissuer names in the form \fBhost@group\fP and should match the
913290001Sglebius\'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in
914290001Sglebius\fBntpd\fP's configuration file. 
915290001Sglebius.It  Fl l Ar lifetime , Fl \-lifetime Ns = Ns Ar lifetime 
916290001Sglebiusset certificate lifetime.
917290001SglebiusThis option takes an integer number as its argument.
918290001Sglebius.sp
919290001SglebiusSet the certificate expiration to lifetime days from now.
920290001Sglebius.It  Fl M , Fl \-md5key 
921290001Sglebiusgenerate MD5 keys.
922290001Sglebius.sp
923290001SglebiusGenerate MD5 keys, obsoleting any that may exist.
924290001Sglebius.It  Fl m Ar modulus , Fl \-modulus Ns = Ns Ar modulus 
925290001Sglebiusmodulus.
926290001SglebiusThis option takes an integer number as its argument.
927290001SglebiusThe value of
928290001Sglebius.Ar modulus
929290001Sglebiusis constrained to being:
930290001Sglebius.in +4
931290001Sglebius.nf
932290001Sglebius.na
933290001Sglebiusin the range  256 through 2048
934290001Sglebius.fi
935290001Sglebius.in -4
936290001Sglebius.sp
937290001SglebiusThe number of bits in the prime modulus.  The default is 512.
938290001Sglebius.It  Fl P , Fl \-pvt\-cert 
939290001Sglebiusgenerate PC private certificate.
940290001Sglebius.sp
941290001SglebiusGenerate a private certificate.  By default, the program generates
942290001Sglebiuspublic certificates.
943290001Sglebius.It  Fl p Ar passwd , Fl \-password Ns = Ns Ar passwd 
944290001Sglebiuslocal private password.
945290001Sglebius.sp
946290001SglebiusLocal files containing private data are encrypted with the
947290001SglebiusDES\-CBC algorithm and the specified password.  The same password
948290001Sglebiusmust be specified to the local ntpd via the "crypto pw password"
949290001Sglebiusconfiguration command.  The default password is the local
950290001Sglebiushostname.
951290001Sglebius.It  Fl q Ar passwd , Fl \-export\-passwd Ns = Ns Ar passwd 
952290001Sglebiusexport IFF or GQ group keys with password.
953290001Sglebius.sp
954290001SglebiusExport IFF or GQ identity group keys to the standard output,
955290001Sglebiusencrypted with the DES\-CBC algorithm and the specified password.
956290001SglebiusThe same password must be specified to the remote ntpd via the
957290001Sglebius"crypto pw password" configuration command.  See also the option
958290001Sglebius-\-id\-key (\-e) for unencrypted exports.
959290001Sglebius.It  Fl S Ar sign , Fl \-sign\-key Ns = Ns Ar sign 
960290001Sglebiusgenerate sign key (RSA or DSA).
961290001Sglebius.sp
962290001SglebiusGenerate a new sign key of the designated type, obsoleting any
963290001Sglebiusthat may exist.  By default, the program uses the host key as the
964290001Sglebiussign key.
965290001Sglebius.It  Fl s Ar host@group , Fl \-subject\-name Ns = Ns Ar host@group 
966290001Sglebiusset host and optionally group name.
967290001Sglebius.sp
968290001SglebiusSet the Autokey host name, and optionally, group name specified
969290001Sglebiusfollowing an '\fB@\fP' character.  The host name is used in the file
970290001Sglebiusname of generated host and signing certificates, without the
971290001Sglebiusgroup name.  The host name, and if provided, group name are used
972290001Sglebiusin \fBhost@group\fP form for the host certificate's subject and issuer
973290001Sglebiusfields.  Specifying '\fB\-s @group\fP' is allowed, and results in
974290001Sglebiusleaving the host name unchanged while appending \fB@group\fP to the
975290001Sglebiussubject and issuer fields, as with \fB\-i group\fP.  The group name, or
976290001Sglebiusif not provided, the host name are also used in the file names
977290001Sglebiusof IFF, GQ, and MV client parameter files.
978290001Sglebius.It  Fl T , Fl \-trusted\-cert 
979290001Sglebiustrusted certificate (TC scheme).
980290001Sglebius.sp
981290001SglebiusGenerate a trusted certificate.  By default, the program generates
982290001Sglebiusa non\-trusted certificate.
983290001Sglebius.It  Fl V Ar num , Fl \-mv\-params Ns = Ns Ar num 
984290001Sglebiusgenerate <num> MV parameters.
985290001SglebiusThis option takes an integer number as its argument.
986290001Sglebius.sp
987290001SglebiusGenerate parameters and keys for the Mu\-Varadharajan (MV)
988290001Sglebiusidentification scheme.
989290001Sglebius.It  Fl v Ar num , Fl \-mv\-keys Ns = Ns Ar num 
990290001Sglebiusupdate <num> MV keys.
991290001SglebiusThis option takes an integer number as its argument.
992290001Sglebius.sp
993290001SglebiusThis option has not been fully documented.
994290001Sglebius.It Fl \&? , Fl \-help
995290001SglebiusDisplay usage information and exit.
996290001Sglebius.It Fl \&! , Fl \-more\-help
997290001SglebiusPass the extended usage information through a pager.
998290001Sglebius.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
999290001SglebiusSave the option state to \fIcfgfile\fP.  The default is the \fIlast\fP
1000290001Sglebiusconfiguration file listed in the \fBOPTION PRESETS\fP section, below.
1001290001SglebiusThe command will exit after updating the config file.
1002290001Sglebius.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
1003290001SglebiusLoad options from \fIcfgfile\fP.
1004290001SglebiusThe \fIno\-load\-opts\fP form will disable the loading
1005290001Sglebiusof earlier config/rc/ini files.  \fI\-\-no\-load\-opts\fP is handled early,
1006290001Sglebiusout of order.
1007290001Sglebius.It Fl \-version Op Brq Ar v|c|n
1008290001SglebiusOutput version of program and exit.  The default mode is `v', a simple
1009290001Sglebiusversion.  The `c' mode will print copyright information and `n' will
1010290001Sglebiusprint the full copyright notice.
1011290001Sglebius.El
1012290001Sglebius.Sh "OPTION PRESETS"
1013290001SglebiusAny option that is not marked as \fInot presettable\fP may be preset
1014290001Sglebiusby loading values from configuration ("RC" or ".INI") file(s) and values from
1015290001Sglebiusenvironment variables named:
1016290001Sglebius.nf
1017290001Sglebius  \fBNTP_KEYGEN_<option\-name>\fP or \fBNTP_KEYGEN\fP
1018290001Sglebius.fi
1019290001Sglebius.ad
1020290001SglebiusThe environmental presets take precedence (are processed later than)
1021290001Sglebiusthe configuration files.
1022290001SglebiusThe \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
1023290001SglebiusIf any of these are directories, then the file \fI.ntprc\fP
1024290001Sglebiusis searched for within those directories.
1025290001Sglebius.Sh USAGE
1026290001SglebiusThe
1027290001Sglebius.Fl p Ar password
1028290001Sglebiusoption specifies the write password and
1029290001Sglebius.Fl q Ar password
1030290001Sglebiusoption the read password for previously encrypted files.
1031290001SglebiusThe
1032290001Sglebius.Nm
1033290001Sglebiusprogram prompts for the password if it reads an encrypted file
1034290001Sglebiusand the password is missing or incorrect.
1035290001SglebiusIf an encrypted file is read successfully and
1036290001Sglebiusno write password is specified, the read password is used
1037290001Sglebiusas the write password by default.
1038290001Sglebius.Sh "ENVIRONMENT"
1039290001SglebiusSee \fBOPTION PRESETS\fP for configuration environment variables.
1040290001Sglebius.Sh "FILES"
1041290001SglebiusSee \fBOPTION PRESETS\fP for configuration files.
1042290001Sglebius.Sh "EXIT STATUS"
1043290001SglebiusOne of the following exit values will be returned:
1044290001Sglebius.Bl -tag
1045290001Sglebius.It 0 " (EXIT_SUCCESS)"
1046290001SglebiusSuccessful program execution.
1047290001Sglebius.It 1 " (EXIT_FAILURE)"
1048290001SglebiusThe operation failed or the command syntax was not valid.
1049290001Sglebius.It 66 " (EX_NOINPUT)"
1050290001SglebiusA specified configuration file could not be loaded.
1051290001Sglebius.It 70 " (EX_SOFTWARE)"
1052290001Sglebiuslibopts had an internal operational error.  Please report
1053290001Sglebiusit to autogen\-users@lists.sourceforge.net.  Thank you.
1054290001Sglebius.El
1055290001Sglebius.Sh "AUTHORS"
1056290001SglebiusThe University of Delaware and Network Time Foundation
1057290001Sglebius.Sh "COPYRIGHT"
1058294905SdelphijCopyright (C) 1992\-2016 The University of Delaware and Network Time Foundation all rights reserved.
1059290001SglebiusThis program is released under the terms of the NTP license, <http://ntp.org/license>.
1060290001Sglebius.Sh BUGS
1061158688SpavIt can take quite a while to generate some cryptographic values,
1062158688Spavfrom one to several minutes with modern architectures
1063158688Spavsuch as UltraSPARC and up to tens of minutes to an hour
1064158688Spavwith older architectures such as SPARC IPC.
1065290001Sglebius.Pp
1066290001SglebiusPlease report bugs to http://bugs.ntp.org .
1067290001Sglebius.Pp
1068290001SglebiusPlease send bug reports to: http://bugs.ntp.org, bugs@ntp.org
1069290001Sglebius.Sh NOTES
1070290001SglebiusPortions of this document came from FreeBSD.
1071290001Sglebius.Pp
1072290001SglebiusThis manual page was \fIAutoGen\fP\-erated from the \fBntp\-keygen\fP
1073290001Sglebiusoption definitions.
1074