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