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