progs/rspit.c: Include Salsa20 and ChaCha (and their variants).
[catacomb] / progs / key.1
CommitLineData
d03ab969 1.\" -*-nroff-*-
052b36d0 2.ie t \{\
8404fd75 3. if \n(.g \{\
4. fam P
5. \}
052b36d0 6. ds ss \s8\u
7. ds se \d\s0
1476eebc 8. ds us \s8\d
9. ds ue \u\s0
8404fd75 10. ds *b \(*b
052b36d0 11.\}
12.el \{\
13. ds ss ^
14. ds se
1476eebc 15. ds us _
8404fd75 16. ds ue
17. ds *b \fIbeta\fP
052b36d0 18.\}
c65df279 19.de VS
20.sp 1
21.RS
22.nf
23.ft B
24..
25.de VE
26.ft R
27.fi
28.RE
29.sp 1
30..
d07dfe80 31.TH key 1 "5 June 1999" "Straylight/Edgeware" "Catacomb cryptographic library"
d03ab969 32.SH NAME
33key \- simple key management system
34.SH SYNOPSIS
35.B key
36.RB [ \-k
37.IR keyring ]
38.I command
39.PP
40where
41.I command
42is one of:
43.PP
c65df279 44.B help
45.RI [ command ...]
46.br
47.B show
48.RI [ item ...]
49.br
d03ab969 50.B add
4e67e30b 51.RB [ \-lqrLKS ]
052b36d0 52.RB [ \-a
53.IR alg ]
54.RB [ \-b | \-B
d03ab969 55.IR bits ]
052b36d0 56.RB [ \-p
57.IR param ]
d07dfe80 58.RB [ \-R
052b36d0 59.IR tag ]
60.br
61\h'8n'
c65df279 62.RB [ \-A
63.IR seed-alg ]
64.RB [ \-s
65.IR seed ]
66.RB [ \-n
67.IR bits ]
68.br
69\h'8n'
d03ab969 70.RB [ \-e
71.IR expire ]
052b36d0 72.RB [ \-t
73.IR tag ]
d03ab969 74.RB [ \-c
75.IR comment ]
eb31b00e 76.RB [ \-C
77.IR curve ]
78.br
79\h'8n'
d03ab969 80.I type
81.IR attr ...
82.br
83.B expire
052b36d0 84.IR tag ...
d03ab969 85.br
86.B delete
052b36d0 87.IR tag ...
88.br
89.B tag
90.I tag
91.RI [ new-tag ]
92.br
93.B comment
94.I tag
95.RI [ comment ]
d03ab969 96.br
97.B setattr
052b36d0 98.I tag
d03ab969 99.IR attr ...
100.br
e9be047b 101.B getattr
102.I tag
103.I attr
104.br
052b36d0 105.B lock
106.I qtag
107.br
108.B unlock
109.I qtag
110.br
d03ab969 111.B list
052b36d0 112.RB [ \-uqv ]
113.RB [ \-f
114.IR filter ]
115.RI [ tag ...]
116.br
117.B fingerprint
118.RB [ \-f
119.IR filter ]
b817bfc6 120.RB [ \-a
121.IR hash ]
052b36d0 122.RI [ tag ...]
d03ab969 123.br
58507325 124.B verify
125.RB [ \-f
126.IR filter ]
127.RB [ \-a
128.IR hash ]
129.I tag
130.I fingerprint
131.br
d03ab969 132.B tidy
133.br
134.B extract
052b36d0 135.RB [ \-f
136.IR filter ]
d03ab969 137.I file
052b36d0 138.RI [ tag ...]
d03ab969 139.br
140.B merge
141.I file
142.SH DESCRIPTION
143The
144.B key
145command performs useful operations on Catacomb keyring files. It
146provides a number of subcommands, by which the various operations may be
147carried out.
148.SS "Global options"
149Before the command name,
150.I "global options"
151may be given. The following global options are supported:
152.TP
c65df279 153.BR "\-h, \-\-help " [ \fIcommand ...]
d03ab969 154Writes a brief summary of
155.BR key 's
156various options to standard output, and
c65df279 157returns a successful exit status. With command names, gives help on
158those commands.
d03ab969 159.TP
160.B "\-v, \-\-version"
161Writes the program's version number to standard output, and returns a
162successful exit status.
163.TP
164.B "\-u, \-\-usage"
165Writes a very terse command line summary to standard output, and returns
166a successful exit status.
167.TP
c9e31e42 168.BI "\-k, \-\-keyring " file
d03ab969 169Names the keyring file which
170.B key
171is to process. The default keyring, used if this option doesn't specify
172one, is the file named
173.B keyring
174in the current directory. The keyring must be stored in a regular file:
175pipes, sockets, devices etc. are not allowed.
176The
177.B key
178program attempts to lock the keyring before accessing it, using
179.BR fcntl (2)
180locking. It will however time out after a short while (10 seconds) and
181report a failure.
182.SS Concepts
183In addition to the actual key data itself, a Catacomb key has a number
184of other pieces of information attached to it:
185.TP
052b36d0 186.B "keyid"
187Every key has a 32-bit identifying number, written in hexadecimal.
188Keyids are not actually related to the key contents: they're generated
189randomly. Applications use keyids to refer to specific keys; users are
190probably better off with tags and types. A
d03ab969 191.I deleted
192key cannot be looked up by keyid.
193.TP
052b36d0 194.B "tag"
195A key's tag is a unique string which can be used by users and
196applications to identify the key. Tag strings may not contain spaces,
197colons or dots. A
198.I deleted
199key cannot be looked up by tag. Whenever a tag name is wanted, a hex
200keyid or key type string can be given instead.
201.TP
202.B "type"
d03ab969 203A key's type string describes what the key may be used for. The type
204string is arbitrary, except that it may not contain whitespace
052b36d0 205characters, dots or colons. Applications use key types to obtain an
206arbitrary but suitable key for some purpose. An
d03ab969 207.I expired
052b36d0 208key cannot be looked up by type, but may be looked up by keyid or tag.
209.TP
210.B "key encoding"
211There are a number of different ways in which keys can be represented,
212according to the uses to which the key will be put. Most symmetric
213algorithms use
214.I binary
215keys. Keys used with number-theoretic systems (like most common
216public-key systems) use
217.I "multiprecision integer"
8404fd75 218keys. Elliptic curve systems use
219.I "curve point"
220keys, which are either a pair of integers representing field elements,
221or a `point at infinity'. Algorithms which require several key
222constituents (again, like most public-key systems) use
052b36d0 223.I structured
8404fd75 224keys, which consist of a collection of named parts. It's possible to
225store an
226.I "ASCII string"
227as a key, though this is usually done as a component of a structured
228key. Finally, keys (including structured keys) can be encrypted.
052b36d0 229.TP
230.B "filter"
231Keys and key components may be selected by a filter expression, a
232sequence of flag names separated by commas. Flags are:
233.BR binary ,
234.BR integer ,
8404fd75 235.BR struct ,
236.BR ec ,
237.BR string ,
052b36d0 238or
239.B encrypt
240(describing the key encoding);
241.BR symmetric ,
242.BR private ,
8404fd75 243.BR public ,
052b36d0 244or
245.B shared
246(describing the category of key);
247.B burn
248and its negation
249.B \-burn
250(whether the key should be erased from memory after use); and
251.B secret
252and its negation
253.B \-secret
254(whether the key is safe to divulge).
255.TP
256.B "qualified tag"
257A key component may be identified by the key's tag (or keyid, or type).
258Subcomponents of structured keys are identified by following the tag by
259a dot and the name of the subcomponent.
d03ab969 260.TP
261.B "expiry time"
262Most keys expire after a certain amount of time. Once a key has
263expired, it will no longer be chosen as a result of a lookup by key
264type. However, it is not deleted until its deletion time is also
265reached.
266.TP
267.B "deletion time"
268A key's deletion time is the latest expiry time of any of the objects
269which require that key. For example, a key used for authenticating
270cryptographic cookies should have its deletion time set to the longest
052b36d0 271expiry time of any of the cookies it can authenticate. Once a key's
272deletion time is passed, it can no longer be referred to by
d03ab969 273applications, and will be removed from the keyring next time it's
274written to disk.
275.TP
052b36d0 276.B "comment"
d03ab969 277A key may be given a comment when it's created. The comment is for the
278benefit of users, and isn't interpreted by applications at all.
279(Hopefully.)
280.TP
052b36d0 281.B "attributes"
ef3b232f
MW
282A key has zero or more name/value pairs. The names and values are
283arbitrary strings, except that they may not contain null bytes. Some
d03ab969 284attributes may have meaning for particular applications or key types;
285others may be assigned global meanings in future.
286.SH "COMMAND REFERENCE"
c65df279 287.SS help
288The
289.B help
290command behaves exactly as the
291.B \-\-help
292option. With no arguments, it shows an overview of
293.BR key 's
294options; with arguments, it describes the named subcommands.
295.SS show
296The
297.B show
298command prints various lists of tokens understood by
299.BR key .
300With no arguments, it prints all of the lists; with arguments, it prints
301just the named lists, in order. The recognized lists can be enumerated
302using the
303.VS
304key show list
305.VE
306command. The lists are as follows.
307.TP
308.B list
309The lists which can be enumerated by the
310.B show
311command.
312.TP
313.B hash
314The hash functions which can be used with the
315.B fingerprint
58507325 316and
317.B verify
318commands.
c65df279 319.TP
320.B ec
321The built-in elliptic curves which can be used with the
322.B add \-a ec
323command.
324.TP
325.B dh
ef3b232f 326The built-in Diffie\(enHellman groups which can be used with the
c65df279 327.B add \-a dh
328command.
329.TP
330.B keygen
331The key-generation algorithms which are acceptable to the
332.B \-a
333option of the
334.B add
335command.
336.TP
337.B seed
338The pseudorandom generators which are acceptable to the
339.B \-s
340option of the
341.B add
342command.
d03ab969 343.SS add
344The
345.B add
346command creates a new key and adds it to the keyring. The command
347accepts the following options:
348.TP
052b36d0 349.BI "\-a, \-\-algorithm " alg
350Selects a key generation algorithm. The default algorithm is
351.BR binary ;
c65df279 352the different algorithms are described below. The command
353.B key show keygen
354lists the recognized key-generation algorithms.
052b36d0 355.TP
c9e31e42 356.BI "\-b, \-\-bits " bits
d03ab969 357The length of the key to generate, in bits. The default, if this option
052b36d0 358is not supplied, depends on the key-generation algorithm.
359.TP
360.BI "\-B, \-\-qbits " bits
361The length of the subsidiary key or parameter, in bits. Not all
362key-generation algorithms have a subsidiary key size.
363.TP
364.BI "\-p, \-\-parameters " tag
365Selects a key containing parameter values to copy. Not all
4739c68a 366key-generation algorithms allow the use of shared parameters. A new key
367also inherits attributes from its parameter key.
d03ab969 368.TP
c65df279 369.BI "\-A, \-\-seedalg " seed-alg
370Use the deterministic random number generator algorithm
371.I seed-alg
372to generate the key. Use
373.I before
374the
375.B \-s
376or
377.B \-n
378options; without one of these,
379.B \-A
380has no effect. The default algorithm is
381.BR rmd160-mgf .
382The command
383.B key show seed
384shows a list of recognized seeding algorithms. The seeding algorithm
385used to generate a key is recorded as the key's
386.B seedalg
387attribute.
388.TP
389.BI "\-s, \-\-seed " seed
390Generate the key deterministically using the given
391.IR seed ,
392which should be a Base64-encoded binary string. This is mainly useful
393for parameters keys (types
394.BR dsa-param
395and
396.BR dh-param ),
397to demonstrate that a set of parameters has been generated in an honest
398fashion. The
399.B dsarand
400generation algorithm can be used to generate
401.B dsa-param
402keys as required by FIPS186. The requested seed is recorded,
403Base64-encoded, as the new key's
404.B seed
405attribute.
406.TP
407.BI "\-n, \-\-newseed " bits
408Generate a new seed, with the given length in
409.IR bits .
410The generated seed is recorded, Base64-encoded, as the new key's
411.B seed
412attribute.
413.TP
c9e31e42 414.BI "\-e, \-\-expire " expire
d03ab969 415The expiry date for the generated key. This may be the string
416.RB ` forever '
417if the key should never expire automatically, or any date acceptable to
418the
419.BR getdate (3)
420library function. Briefly,
421.B getdate
422understands absolute dates such as
423.RB ` 1999-08-02 '
424or
425.RB ` "August 2nd, 1999" ',
426and (perhaps more usefully) relative dates such as
427.RB ` "+2 weeks" '.
428The default is to allow a 2 week expiry, which isn't useful.
429.TP
c9e31e42 430.BI "\-c, \-\-comment " comment
d03ab969 431Sets a comment for the key. The default is not to attach a comment.
052b36d0 432.TP
eb31b00e 433.BI "\-C, \-\-curve " curve-spec
434Use the elliptic curve described by
435.I curve-spec
436when generating elliptic curve parameters.
437.TP
052b36d0 438.BI "\-t, \-\-tag " tag
439Selects a tag string for the key. The default is not to set a tag. It
440is an error to select a tag which already exists.
441.TP
d07dfe80 442.BI "\-r, \-\-retag"
443If a
444.B \-t
445option is given, remove this tag from any key which already has it.
446.TP
447.BI "\-R, \-\-rand-id " tag
052b36d0 448Selects the key to use for the random number generator. Catacomb's
449random number generator can be
450.IR keyed ,
451so that, even if the inputs to the generator are compromised, knowledge
452of the key is also necessary to be able to predict the output. By
453default, the latest-expiring key with type
454.B catacomb-rand
455is used, if present; if not, no key is used.
456.TP
457.BI "\-l, \-\-lock"
458Requests that the secret parts of the newly-generated key be encrypted
459using a passphrase.
460.TP
461.BI "\-q, \-\-quiet"
462Suppresses the progress indication which is usually generated while
463time-consuming key generation tasks are being performed.
1476eebc 464.TP
4e67e30b 465.BI "\-L, \-\-lim-lee"
ef3b232f
MW
466When generating Diffie\(enHellman parameters, generate a Lim\(enLee
467prime rather than a random (or safe) prime. See the details on
468Diffie\(enHellman key generation below.
1476eebc 469.TP
4e67e30b 470.BI "\-K, \-\-kcdsa"
ef3b232f
MW
471When generating Diffie\(enHellman parameters, generate a KCDSA-style
472Lim\(enLee prime rather than a random (or safe) prime. See the details
473on Diffie\(enHellman key generation below.
4e67e30b
MW
474.TP
475.BI "\-S, \-\-subgroup"
ef3b232f
MW
476When generating Diffie\(enHellman parameters with a Lim\(enLee prime,
477choose a generator of a prime-order subgroup rather than a subgroup of
478order
479.RI ( p "\ \-\ 1)/2."
d03ab969 480.PP
481The key's type is given by the required
482.I type
483argument. Following the type are zero or more attributes, which are
484attached to the key in the same way as for the
485.B setattr
486command.
487.PP
052b36d0 488The key-generation algorithms supported are as follows:
489.TP
490.B "binary"
491Generates a plain binary key of the requested length. If the requested
492key length is not a multiple of eight, the high-order bits of the first
493octet of the key are zeroed. The default key length is 128 bits.
494.TP
495.B "des"
496Generates a DES key, with parity bits. The key length must be 56, 112
497or 168; the default is 56. The low-order bit of each octet is ignored by
498the DES algorithm; it is used to give each octet odd parity.
499.TP
500.B "rsa"
501Generates a public/private key pair for use with the RSA algorithm.
502.IP
503The key components are
504.I p
505and
506.IR q ,
507a pair of prime numbers;
508.IR n ,
509the product of
510.I p
511and
512.IR q ;
513.IR e ,
514the public exponent;
515.IR d ,
516the private exponent, chosen such that
ef3b232f 517.IR ed \~\(==\~1
052b36d0 518(mod
ef3b232f 519.RI lcm( p "\~\-\~1, " q \~\-\~1));
052b36d0 520and some other values useful for optimizing private-key operations:
ef3b232f
MW
521.IR q "\*(ss\-1\*(se mod " p ,
522.IR d "\~mod " p \~\-\~1,
052b36d0 523and
ef3b232f 524.IR d "\~mod " q \~\-\~1.
052b36d0 525The values
526.I n
527and
528.I e
529constitute the public key; the rest must be kept secret. The key size
530requested by the
531.B \-b
532option determines the size of the modulus
533.IR n ;
534the default is 1024 bits.
535.IP
536The key generation algorithm chooses
537.I p
538and
539.I q
540to be
541.I strong
542primes: both
ef3b232f 543.IR p \~\-\~1
052b36d0 544and
ef3b232f
MW
545.IR p \~+\~1
546have large prime factors \(en call them
052b36d0 547.I r
548and
549.I s
ef3b232f
MW
550respectively \(en and
551.IR r \~\-\~1
052b36d0 552also has a large prime factor;
553.I q
554has similar properties.
555.IP
556The modulus
557.I n
558cannot be sensibly used as a shared parameter, since knowledge of
559corrssponding public and private exponents is sufficient to be able to
560factor the modulus and recover other users' private keys.
561.TP
eb31b00e 562.B "dh-param"
ef3b232f 563Generates parameters for use with the Diffie\(enHellman key exchange
052b36d0 564protocol, and many related systems, such as ElGamal encryption and
1476eebc 565signatures, and even DSA. (The separate DSA algorithm uses the
566generator described in FIPS186-1.)
567.IP
ef3b232f 568The Diffie\(enHellman parameters are a prime modulus
1476eebc 569.I p
052b36d0 570and a generator
571.I g
1476eebc 572of a subgroup of
573.BR Z / \c
574.IB p Z
575of order
576.IR q .
577The
052b36d0 578.B \-b
1476eebc 579option controls the size of the modulus
052b36d0 580.IR p ;
1476eebc 581the default size is 1024 bits.
582.IP
45c0fd36 583If no
052b36d0 584.I q
1476eebc 585size is selected using the
052b36d0 586.B \-B
ef3b232f 587option and the Lim\(enLee prime options are disabled, then
1476eebc 588.I p
589is chosen to be a `safe' prime (i.e.,
ef3b232f 590.IR p "\~= 2" q \~+\~1,
1476eebc 591with
592.I q
8404fd75 593prime). Finding safe primes takes a very long time. In this case, the
594value of
1476eebc 595.I g
596is fixed as 4.
597.IP
598If a size is chosen for
599.I q
ef3b232f 600and Lim\(enLee primes are not selected then the prime
1476eebc 601.I q
602is generated and
603.I p
604is chosen so that
ef3b232f 605.IR p \~\-\~1
1476eebc 606is a multiple of
607.IR q .
608.IP
609If the
610.B \-L
ef3b232f
MW
611option was given, Lim\(enLee primes are selected: the parameters are
612chosen such that
613.IR p "\~= 2\~" q \*(us0\*(ue
614.IR q \*(us1\*(ue
615.IR q \*(us2\*(ue\~...\~+\~1,
1476eebc 616where the
ef3b232f 617.IR q \*(us i \*(ue
1476eebc 618are primes at least as large as the setting given by the
619.B \-B
620option (or 256 bits, if no setting was given).
052b36d0 621.IP
1476eebc 622If the
45c0fd36 623.B \-K
ef3b232f 624option was given, KCDSA-style Lim\(enLee primes are selected: the
4e67e30b 625parameters are chosen such that
ef3b232f 626.IR p "\~= 2" qv \~+\~1,
4e67e30b 627where
45c0fd36 628.IR p,
4e67e30b
MW
629.I q
630and
631.I v
632are primes.
633.IP
634If the
1476eebc 635.B \-S
4e67e30b
MW
636or
637.B \-K
638options were given, the generator
1476eebc 639.I g
640is chosen to generate the subgroup of order
641.IR q \*(us0\*(ue;
642otherwise,
643.I g
644will generate the group of order
ef3b232f
MW
645.RI ( p "\~\-\~1)/2\~= " q "\*(us0\*(ue " q \*(us1\*(ue
646.IR q \*(us2\*(ue\~...
8404fd75 647.IP
648Finally, the
649.B \-C
650option can be given, in which case the parameters are taken directly
651from the provided group specification, which may either be the the name
652of one of the built-in groups (say
58507325 653.B "key show dh"
8404fd75 654for a list) or a triple
ef3b232f 655.RI ( p ,\~ q ,\~ g ).
8404fd75 656separated by commas. No random generation is done in this case: the
657given parameters are simply stored.
052b36d0 658.TP
659.B "dh"
ef3b232f 660Generates a public/private key pair for use with offline Diffie\(enHellman,
052b36d0 661ElGamal, DSA or similar discrete-logarithm-based systems. It selects a
662private key
ef3b232f 663.IR x \~<\~ q ,
052b36d0 664and computes the public key
ef3b232f 665.IR y "\~= " g \*(ss x "\*(se mod\~" p .
052b36d0 666.TP
667.B "dsa-param"
668Generates parameters for the DSA algorithm. DSA parameters are also
ef3b232f 669suitable for use with Diffie\(enHellman and ElGamal system.
052b36d0 670.IP
ef3b232f 671The main difference between DSA and Diffie\(enHellman parameter generation
052b36d0 672is thatthe DSA parameter generation
673algorithm creates a
674.I seed
675from which the parameters are derived, and, assuming that the SHA-1 hash
676function is strong, it's not feasible to construct a seed from which
677deliberately weak parameters are derived. The algorithm used is the one
678described in the DSA standard, FIPS\ 186, extended only to allow
679sequential search for a prime
680.I q
681and to allow arbitrary parameter sizes. The seed is stored,
682Base64-encoded, as the value of the attribute
683.BR seed .
684.IP
685The default lengths for
686.I p
687and
688.I q
689are 768 and 160 bits respectively, since the DSA standard specifies that
690.I q
691be 160 bits, and the choice of 768 bits for
692.I p
693gives commensurate security.
694.TP
695.B "dsa"
ef3b232f 696Generates a public/private key pair for DSA. As for Diffie\(enHellman
052b36d0 697keys, it selects a
698private key
ef3b232f 699.IR x \~<\~ q ,
052b36d0 700and computes the public key
ef3b232f 701.IR y "\~= " g \*(ss x "\*(se mod\~" p .
052b36d0 702.TP
703.B "bbs"
704Generates a public/private key pair for the Blum-Blum-Shub random-number
705generator, and the Blum-Goldwasser semantically-secure public-key
706encryption system.
707.IP
708The key components are prime numbers
709.I p
710and
711.IR q ,
ef3b232f 712both congruent to 3 (mod\~4), and their product
052b36d0 713.IR n .
714The public key is simply the modulus
715.IR n ;
716the factors
717.I p
718and
719.I q
720are the private key.
721.IP
722The key-generation algorithm ensures that the two primes
723.I p
724and
725.I q
726are
727.I strong
728(see the discussion of strong primes above, in the section on RSA keys),
729and that
ef3b232f 730.RI ( p \~\-\~1)/2
052b36d0 731and
ef3b232f 732.RI ( q \~\-\~1)/2
052b36d0 733are relatively prime, giving a maximum possible period length.
734.IP
735The key size requested by the
736.B \-b
737option determines the length of the modulus
738.IR n ;
739the default length is 1024 bits.
eb31b00e 740.TP
741.B "ec-param"
742Store an elliptic curve specification. If no explicit
743.I curve-spec
744is given (the
745.RB ` \-C '
746option) then a curve is chosen whose order is about the size given by the
747.RB ` \-b '
748option (default is 256 bits).
749.IP
750A
751.I curve-spec
752can be given explicitly (in which case
753.RB ` \-b '
754is ignored). It can either be the name of a built-in curve (say
58507325 755.B "key show ec"
eb31b00e 756for a list of curve names) or a full specification. The curve is
757checked for correctness and security according to the SEC1
758specification: failed checks cause a warning to be issued to standard
759error (though the program continues anyway). The check can be
760suppressed using the
761.RB ` \-q '
762option.
763.IP
764A curve specification consists of the following elements optionally
765separated by whitespace: a
766.IR "field type" ,
767which is one of
768.BR "prime" ,
769.BR "niceprime" ,
8404fd75 770.BR "binpoly" ,
771.or
772.BR "binnorm" ;
eb31b00e 773an optional
774.RB ` : ';
775the field modulus
776.IR p ;
8404fd75 777if the field type is
778.B binnorm
779then an optional
780.RB ` , '
781and the representation of the normal element \*(*b; an optional
20095408 782.RB ` ; ';
eb31b00e 783a
784.IR "curve type" ,
785which is one of
786.BR "prime" ,
787.BR "primeproj" ,
788.BR "bin" ,
789and
790.BR "binproj"
791(the `proj' types currently have much better performance);
792an optional
793.RB ` : ';
794the two field-element parameters
795.I a
796and
45c0fd36 797.IR b
eb31b00e 798which define the elliptic curve
799.IR E ,
800separated by an optional
801.RB ` , ';
802an optional
20095408 803.RB ` ; ';
45c0fd36 804the
eb31b00e 805.IR x -
806and
807.IR y -coordinates
808of the generator point
809.IR G ,
810separated by an optional
811.RB ` , ';
812an optional
813.RB ` : ';
814the order
815.I r
45c0fd36 816of the group generated by
eb31b00e 817.IR G ;
818an optional
819.RB ` * ';
45c0fd36 820and the
eb31b00e 821.I cofactor
822.I h
823=
824.RI # E / r .
825.TP
826.B "ec"
827Generate a private scalar and a corresponding public point on an
828elliptic curve. See
829.B ec-param
830above for how to specify elliptic curve parameter sets. The scalar
831.I x
832is chosen unformly between 0 and the curve order
833.IR r ;
834the public point is then
835.I x
836\(mu
837.IR G .
052b36d0 838.SS "expire"
d03ab969 839Forces keys to immediately expire. An expired key is not chosen when a
840program requests a key by its type. The keys to expire are listed by
841their
052b36d0 842.IR tag s.
843.SS "delete"
d03ab969 844Deletes keys immediately. The keys to delete are listed by their
052b36d0 845.IR tag s.
d03ab969 846Be careful when deleting keys. It might be a better idea
847to expire keys rather than deleting them.
052b36d0 848.SS "tag"
849Sets, deletes or changes the tag attached to a key. The first tag or
850keyid names the key to be modified; the second, if present specifies the
851new tag to be set. If no second argument is given, the existing tag, if
d07dfe80 852any, is removed and no new tag is set. It is an error to set a tag
853which already exists on another key, unless you give the
854.B \-r
855option, which removes the tag first.
052b36d0 856.SS "setattr"
d03ab969 857Attaches attributes to a key. The key to which the attributes should be
858attached is given by its
052b36d0 859.IR tag .
d03ab969 860Each attribute has the form
861.IB name = value\fR.
862An attribute can be deleted by assigning it an empty value. Although
863the keyring file format is capable of representing an attribute with an
864empty value as distinct from a nonexistant attribute, this interface
865does not allow empty attributes to be set.
e9be047b 866.SS "getattr"
867Fetches a single attribute of a key. The key whose attribute is to be
868read is given by its
869.IR tag .
870The attribute's value is written to standard output followed by a
871newline. If the key or attribute is absent, a message is written to
872standard error and the program exits nonzero.
052b36d0 873.SS "comment"
874Sets, deletes or changes the comment attached to a key. The first
875argument is a key tag or keyid which names the key to be modified; the
876second, if present, is the new comment. If no second argument is given,
877the existing comment, if any, is removed, and no new comment is set.
878.SS "lock"
879Locks a key or key component using a passphrase. If the key is already
880locked, the existing passphrase is requested, and a new passphrase is
881set.
882.SS "unlock"
883Unlocks a passphrase-locked key or key component. If the key is not
884locked, an error is reported.
885.SS "list"
d03ab969 886Lists the keys in the keyring. A couple of options are supported:
887.TP
888.B "\-v, \-\-verbose"
889Increases the amount of information displayed for each key. Repeat for
890a greater effect.
891.TP
892.B "\-q, \-\-quiet"
893Decreases the amount of information displayed for each key. Each use
894cancels a
895.RB ` \-v '
896option.
c9e31e42 897.TP
898.B "\-u, \-\-utc"
899Display key expiry times as UTC rather than using the local time zone.
052b36d0 900.TP
901.BI "\-f, \-\-filter " filter
902Specifies a filter. Only keys and key components which match the filter
903are listed.
d03ab969 904.PP
905By default, a single line of output is generated for each, showing
906keyids, types, expiry and deletion dates, and comments. Additional
907.RB ` \-v '
908options show more information, such as the exact time of day for expiry
052b36d0 909and deletion, key attributes, and a dump of the actual key data. If the
910verbosity level is sufficiently high, passphrases are requested to
911decrypt locked keys. Make sure nobody is looking over your shoulder
912when you do this!
913.SS "fingerprint"
914Reports a fingerprint (secure hash) on components of requested keys.
58507325 915The following options are supported:
052b36d0 916.TP
917.BI "\-f, \-\-filter " filter
918Specifies a filter. Only keys and key components which match the filter
919are fingerprinted. The default is to only fingerprint nonsecret
920components.
b817bfc6 921.TP
922.BI "\-a, \-\-algorithm " hash
923Names the hashing algorithm. Run
58507325 924.B key show hash
b817bfc6 925for a list of hashing algorithms. The default is
926.BR rmd160 .
052b36d0 927.PP
928The keys to be fingerprinted are named by their tags or keyids given as
929command line arguments. If no key tags are given, all keys which match
b817bfc6 930the filter are fingerprinted. See
931.BR keyring (5)
932for a description of how key fingerprints are computed.
58507325 933.SS "verify"
934Check a key's fingerprint against a reference copy. The following
935options are supported:
936.TP
937.BI "\-f, \-\-filter " filter
938Specifies a filter. Only key components which match the filter are
939hashed. The default is to only fingerprint nonsecret components. An
940error is reported if no part of the key matches.
941.TP
942.BI "\-a, \-\-algorithm " hash
943Names the hashing algorithm. Run
944.B key show hash
945for a list of hashing algorithms. The default is
946.BR rmd160 .
947.PP
948The reference fingerprint is given as hex, in upper or lower case. The
949hash may contain hyphens, colons and whitespace. Other characters are
950not permitted.
052b36d0 951.SS "tidy"
d03ab969 952Simply reads the keyring from file and writes it back again. This has
953the effect of removing any deleted keys from the file.
052b36d0 954.SS "extract"
955Writes a selection of keys to a file. An option is supported:
956.TP
957.BI "\-f, \-\-filter " filter
958Specifies a filter. Only keys and key components which match the filter
959are written.
960.PP
961Keys extracted are written to the file named by the first argument,
d03ab969 962which may be
963.RB ` \- '
964to designate standard output. The keys to extract are listed by their
052b36d0 965tags; if no tags are given, all keys which match the filter are
966extracted. The output is a valid keyring file.
967.SS "merge"
d03ab969 968Merges the keys from the named
969.IR file ,
970which may be
971.RB ` \- '
972to designate standard input, with the keyring. Keys already in the
973keyring are not overwritten: you must explicitly remove them first if
974you want them to be replaced during the merge.
d03ab969 975.SH "SEE ALSO"
976.BR keyring (5).
977.SH AUTHOR
f387fcb1 978Mark Wooding, <mdw@distorted.org.uk>