22 \h'-\w'\\$1\ 'u'\\$1\ \c
27 .TH catsign 1 "17 March 2005" "Straylight/Edgeware" "Catacomb cryptographic library"
29 catsign \- sign and verify messages
110 command signs and verifies messages. It also works as a simple PEM
111 encoder and decoder. It provides a number of subcommands, by which the
112 various operations may be carried out.
114 Before the command name,
116 may be given. The following global options are supported:
118 .BR "\-h, \-\-help " [ \fIcommand ...]
119 Writes a brief summary of
121 various options to standard output, and returns a successful exit
122 status. With command names, gives help on those commands.
124 .B "\-v, \-\-version"
125 Writes the program's version number to standard output, and returns a
126 successful exit status.
129 Writes a very terse command line summary to standard output, and returns
130 a successful exit status.
132 .BI "\-k, \-\-keyring " file
133 Names the keyring file which
135 is to process. The default keyring, used if this option doesn't specify
136 one, is the file named
138 in the current directory. See
142 for more details about keyring files.
144 Algorithms to be used with a particular key are described by attributes
145 on the key, or its type. The
147 command deals with signing keys. (Note that
149 uses signing keys in the same way as
160 attribute is present on the key, then it must have this form; otherwise,
161 the key's type must have the form
164 Algorithm selections are taken from appropriately-named attributes, or,
165 failing that, from the
168 The signature algorithm is chosen according to the setting of
172 for a list of supported signature algorithms.
175 This is almost the same as the RSASSA-PKCS1-v1_5 algorithm described in
176 RFC3447; the difference is that the hash is left bare rather than being
177 wrapped in a DER-encoded
179 structure. This doesn't affect security since the key can only be used
180 with the one hash function anyway, and dropping the DER wrapping permits
181 rapid adoption of new hash functions. Regardless, use of this algorithm
182 is not recommended, since the padding method has been shown vulnerable
192 This is the RSASSA-PSS algorithm described in RFC3447. It is the
193 preferred RSA-based signature scheme. Use the
202 This is the DSA algorithm described in FIPS180-1 and FIPS180-2. Use the
211 This is the ECDSA algorithm described in ANSI X9.62 and FIPS180-2. Use
221 This is the revised KCDSA (Korean Certificate-based Digital Signature
222 Algorithm) described in
223 .I The Revised Version of KCDSA
224 .RB ( http://dasan.sejong.ac.kr/~chlim/pub/kcdsa1.ps ).
236 This is an unofficial elliptic-curve analogue of the KCDSA algorithm.
245 As well as the signature algorithm itself, a hash function is used.
246 This is taken from the
248 attribute on the key, or, failing that, from the
252 or, if that is absent, determined by the signature algorithm as follows.
260 the default hash function is
267 the default hash function is
272 for a list of supported hash functions.
274 Two encodings for the ciphertext are supported.
277 The raw format, which has the benefit of being smaller, but needs to be
278 attached to mail messages and generally handled with care.
281 PEM-encapsulated Base-64 encoded text. This format can be included
282 directly in email and picked out again automatically; but there is a
283 4-to-3 data expansion as a result.
284 .SH "SIGNATURE FORMATS"
285 There are two basic signature formats understood by
288 Embedded signatures include (embed) the message they sign; hence they're
289 complete in and of themselves. The
291 program extracts the message during signature verification.
293 Detached signatures are separate from the messages they sign, and both
294 the original file and the signature are required for a successful
297 Another important distinction is whether the message data is considered
298 to be plain text or raw binary data.
300 When dealing with plain text,
302 allows a limited quantity of leeway in the messages it processes. It
303 ignores trailing whitespace on a line, including stray carriage-returns,
304 which may appear if Windows boxes have had their way with the data. It
305 also appends a final newline if there wasn't one before. In embedded
306 signatures, the text is left unencoded, so that the message is readable.
308 Binary files are preserved completely, and no variation whatever is
315 command can convert between detached and embedded signatures; it cannot
316 convert between binary and text mode signatures. (The data actually
317 signed includes a flag saying whether the message is textual. The
318 rationale here is that what looks like an ASCII space before a newline
319 may be devastatingly significant in a binary data file, and if a message
320 is signed as raw binary then no changes whatever should be allowed.)
321 .SH "COMMAND REFERENCE"
325 command behaves exactly as the
327 option. With no arguments, it shows an overview of
329 options; with arguments, it describes the named subcommands.
333 command prints various lists of tokens understood by
335 With no arguments, it prints all of the lists; with arguments, it prints
336 just the named lists, in order. The recognized lists can be enumerated
341 command. The lists are as follows.
344 The lists which can be enumerated by the
349 The signature algorithms which can be used in a signing key's
354 The hash functions which can be used in a key's
359 The encodings which can be applied to encrypted messages; see
365 command signs a message and writes out an appropriately-encoded
366 signature. By default, it reads a message from standard input and
367 writes the signature to standard output. If a filename argument is
368 given, this file is read instead.
370 The following options are recognized.
373 Produce ASCII-armoured output. This is equivalent to specifying
380 Read and sign the input as binary data. The default is to treat the
384 Produce a detached signature. The default is to produce a signature
385 with embedded message.
387 .BI "\-f, \-\-format " format
388 Produce output encoded according to
391 .BI "\-k, \-\-key " tag
392 Use the signing key named
394 in the current keyring; the default key is
397 .BI "\-o, \-\-ouptut " file
400 rather than to standard output.
403 Read and sign the input as text. This is the default.
407 command checks a signature's validity, producing as output information
408 about the signature and the signed message.
410 The first non-option argument is the name of the file containing the
411 signature data; this may be omitted or
413 to indicate that the signature be read from standard input. The second
414 non-option argument, if any, is the name of the file to read the message
415 from, if the signature is detached. An error is reported if a message
416 file is specified but the signature contains an embedded message
417 already; if the signature is detached but no filename is given, then the
418 message is expected on stdin (immediately after the signature, if any).
421 Read ASCII-armoured input. This is equivalent to specifying
428 Buffer the message until the signature is verified. This is forced on
429 if output is to stdout, but is always available as an option.
431 .BI "\-f, \-\-format " format
432 Read input encoded according to
435 .B "\-v, \-\-verbose"
436 Produce more verbose messages. See below for the messages produced
437 during decryption. The default verbosity level is 1. (Currently this
438 is the most verbose setting. This might not be the case always.)
440 Produce fewer messages.
442 .BI "\-k, \-\-key " tag
445 uses the signature header to work out which key to use to verify a
446 signature. Using this option causes verification to fail unless the
447 signature header specifies the key named
451 Show the datestamp in the signature in UTC rather than (your) local
456 .BI "\-o, \-\-output " file
457 Write the verified message to
459 The file is written in text or binary
460 mode as appropriate. The default is to write the message to standard
461 output unless verifying a detached signature, in which case nothing is
464 Output is written to standard output in a machine-readable format.
465 Major problems cause the program to write a diagnostic to standard error
466 and exit nonzero as usual. The quantity of output varies depending on
467 the verbosity level and whether the message is also being written to
468 standard output. Output lines begin with a keyword:
471 An error prevented verification. The program will exit nonzero.
475 encountered a situation which may or may not invalidate the
479 Verification was successful. This is only produced if the message is
480 being sent somewhere other than standard output.
483 The message follows, starting just after the next newline character or
484 sequence. This is only produced if the message is being written to
488 Any other information.
490 The information written at the various verbosity levels is as follows.
492 No output. Watch the exit status.
497 All output written has been checked for authenticity. However, output
498 can fail madway through for many reasons, and the resulting message may
499 therefore be truncated. Don't rely on the output being complete until
506 command analyses a signature without verifying it, and prints
507 interesting information about it. This might be useful for diagnostic
508 purposes. No keys are needed for this operation, though you get more
509 useful information if you have them.
511 If a non-option argument is given, and it is not
513 then it is taken to name the file containing the signature to parse;
514 otherwise a signature is read from standard input.
516 The following options are recognized.
519 Read ASCII-armoured input. This is equivalent to specifying
525 .BI "\-f, \-\-format " format
526 Read input encoded according to
530 Show the datestamp in the signature in UTC rather than (your) local
535 A description of the signature block is produced on standard output; it
536 is mostly machine-readable. The first word on each line explains what
537 kind of output it is.
540 The signature data is invalid and cannot be parsed.
543 Something is wrong with the data, but isn't fatal.
546 An environmental problem means that the information isn't as helpful as
547 it might be. For example, the keyring file can't be opened, so we don't
548 know whether the verification key is there.
550 .BI "INFO flags " flags
551 Describes the flags set in the signature header. The
553 are a list of flags, one per word, preceded by a
555 if the flag is clear.
557 .BI "INFO expected-flags " flags
558 If the PEM boundary string didn't match the actual signature data then
559 this line is output, listing the expected flags and their settings.
560 Problems with boundary mismatches can be resolved using the
564 .BI "INFO date " yyyy "\-" mm "\-" dd " " hh ":" mm ":" ss " " tz
565 Signature was (allegedly!) made at the given time and date. If the
567 option was given, this will be in UTC.
570 Signature was (allegedly!) made using the key
572 which is present in the current keyring.
574 .BI "INFO unknown-key " keyid
575 Signature was (allegedly!) made using the key with id
577 which is not in the current keyring (or the keyring wasn't found).
581 command translates signatures between the various supported formats.
582 This is a (slightly) more complex operation than re-encoding, though it
583 does not require any cryptographic operations.
585 The first non-option argument is the name of the file containing the
586 signature data; this may be omitted or
588 to indicate that the signature be read from standard input. The second
589 non-option argument, if any, is the name of the file to read the message
590 from, if the signature is detached. An error is reported if a message
591 file is specified but the signature contains an embedded message
592 already; if the signature is detached but no filename is given, then the
593 message is expected on stdin (immediately after the signature, if any).
595 The options follow a rough convention: options describing the input
596 format are lower-case and options specifying the output format are
597 upper-case. The following options are recognized.
598 .TP "\-a, \-\-armour-in"
599 Read ASCII-armoured input. This is equivalent to specifying
604 .TP "\-A, \-\-armour-out"
605 Produce ASCII-armoured output. This is equivalent to specifying
612 Produce a detached signature. This may be used to detach a signature
613 from an embedded message.
616 Produce a signature with embedded message. This may be used to
617 reattach a message to its detached signature.
619 .BI "\-f, \-\-format-in " format
620 Read input encoded according to
623 .BI "\-F, \-\-format-out " format
624 Produce output encoded according to
627 .BI "\-m, \-\-message " file
634 then write the message to standard output. Don't send the message and
635 signature to the same place because it doesn't work.
637 .BI "\-o, \-\-output " file
638 Write the signature to
644 option is given, a signature is written to standard output.
646 The trailing-whitespace deletion doesn't work for more than 32K of
647 whitespace. I don't think this is a big problem, really.
651 command does something unhelpful if message and signature are sent to
660 Mark Wooding, <mdw@nsict.org>