22 \h'-\w'\\$1\ 'u'\\$1\ \c
27 .TH dsig 1 "30 September 2004" "Straylight/Edgeware" "Catacomb cryptographic library"
29 dsig \- compute and verify signatures on collections of files
69 command signs and verifies signatures on a collection of files. It
70 provides a number of subcommands, by which the various operations may be
73 Before the command name,
75 may be given. The following global options are supported:
77 .BR "\-h, \-\-help " [ \fIcommand ...]
78 Writes a brief summary of
80 various options to standard output, and returns a successful exit
81 status. With command names, gives help on those commands.
84 Writes the program's version number to standard output, and returns a
85 successful exit status.
88 Writes a very terse command line summary to standard output, and returns
89 a successful exit status.
91 .BI "\-k, \-\-keyring " file
92 Names the keyring file which
94 is to process. The default keyring, used if this option doesn't specify
95 one, is the file named
97 in the current directory. See
101 for more details about keyring files.
111 attribute is present on the key, then it must have this form; otherwise,
112 the key's type must have the form
115 Algorithm selections are taken from appropriately-named attributes, or,
116 failing that, from the
119 The signature algorithm is chosen according to the setting of
123 for a list of supported signature algorithms.
126 This is almost the same as the RSASSA-PKCS1-v1_5 algorithm described in
127 RFC3447; the difference is that the hash is left bare rather than being
128 wrapped in a DER-encoded
130 structure. This doesn't affect security since the key can only be used
131 with the one hash function anyway, and dropping the DER wrapping permits
132 rapid adoption of new hash functions. Regardless, use of this algorithm
133 is not recommended, since the padding method has been shown vulnerable
143 This is the RSASSA-PSS algorithm described in RFC3447. It is the
144 preferred RSA-based signature scheme. Use the
153 This is the DSA algorithm described in FIPS180-1 and FIPS180-2. Use the
162 This is the ECDSA algorithm described in ANSI X9.62 and FIPS180-2. Use
172 This is the revised KCDSA (Korean Certificate-based Digital Signature
173 Algorithm) described in
174 .I The Revised Version of KCDSA
175 .RB ( http://dasan.sejong.ac.kr/~chlim/pub/kcdsa1.ps ).
187 This is an unofficial elliptic-curve analogue of the KCDSA algorithm.
197 This is Bernstein, Duif, Lange, Schwabe, and Yang's Ed25519 algorithm.
198 More specifically, this is HashEd25519
201 algorithm \(en by default
213 This is Bernstein, Duif, Lange, Schwabe, and Yang's EdDSA algorithm,
214 using Hamburg's Ed448-Goldilocks elliptic curve,
215 as specified in RFC8032.
216 More specifically, this is HashEd448
219 algorithm \(en by default
230 As well as the signature algorithm itself, a hash function is used.
231 This is taken from the
233 attribute on the key, or, failing that, from the
237 or, if that is absent, determined by the signature algorithm as follows.
245 the default hash function is
252 the default hash function is
256 the default hash function is
260 the default hash function is
265 for a list of supported hash functions.
266 .SH "COMMAND REFERENCE"
270 command behaves exactly as the
272 option. With no arguments, it shows an overview of
274 options; with arguments, it describes the named subcommands.
278 command prints various lists of tokens understood by
280 With no arguments, it prints all of the lists; with arguments, it prints
281 just the named lists, in order. The recognized lists can be enumerated
286 command. The lists are as follows.
289 The lists which can be enumerated by the
294 The signature algorithms which can be used in a key's
299 The hash functions which can be used in a key's
305 command creates a signature for a collection of files. The default
306 behaviour is to read a list of whitespace-separated file names (see
307 below for the precise format) from standard input and write the
308 an output file, containing hashes of the files and a digital signature
311 in the current keyring, to standard output, in plain text with binary
312 values Base64-encoded. It is intended to be used in conjunction with
314 This behaviour can be modified by specifying command-line options.
317 Read null-terminated filenames, rather than whitespace-separated names.
318 This is the recommended mode of operation if you have a
320 which understands the
325 Produce output in raw binary rather than the textual output. This isn't
326 a useful thing to do unless you're trying to debug
329 .B "\-v, \-\-verbose"
332 more verbose. At present, this just means that it'll print the hashes
333 of files that it comes across in hex. (Use
335 if this is the output you actually wanted.)
342 .BI "\-c, \-\-comment " string
345 as a comment in the output file. The comment's integrity is protected
348 .BI "\-p, \-\-progress"
349 Write a progress meter to standard error while processing large files.
351 .BI "\-f, \-\-file " name
354 instead of from standard input.
356 .BI "\-h, \-\-hashes " name
357 Rather than hashing files, read precomputed hashes from the file
359 which should be in the format produced by
362 .BI "\-o, \-\-output " name
365 instead of to standard output.
367 .BI "\-k, \-\-key " tag
370 rather than the default
373 .BI "\-e, \-\-expire " date
374 Set the signature to expire at
376 The default is to expire 28 days from creation. Use
378 to make the signature not expire.
380 .B "\-C, \-\-nocheck"
381 Don't check the private key for validity. This makes signing go much
382 faster, but at the risk of using a duff key, and potentially leaking
383 information about the private key.
385 The whitespace-separated format for filenames allows quoting and
386 escaping of strange characters. The backslash
388 can be used to escape whitespace, quotes, or other special characters
389 (including itself), and to represent special characters using the
390 standard C escape sequences
398 A filename can be quoted in
403 Whitespace within quotes is part of the filename. The quotes must be at
404 the beginning and end of the name.
408 command will verify signatures made by the
410 command. With no arguments, it expects to read a text-format signature
411 file from standard input; with an argument, it examines the file it
412 names to see whether it's text or binary.
414 Command-line options provided are:
416 .B "\-v, \-\-verbose"
417 Produce more informational output. The default verbosity level is 1.
420 Produce less information output.
423 Report files whose hashes have not been checked.
425 .BI "\-p, \-\-progress"
426 Write a progress meter to standard error while processing large files.
428 .B "\-C, \-\-nocheck"
429 Don't check the public key for validity. This makes verification go
430 much faster, but at the risk of using a duff key, and potentially
431 accepting false signatures.
433 Output is written to standard output in a machine-readable format.
434 Formatting errors cause the program to write a diagnostic to standard
435 error and exit nonzero as usual. Lines begin with a keyword:
438 An error prevented verification.
441 The signature is bad: some file had the wrong hash or the signature is
446 encountered a situation which may or may not invalidate the signature.
449 The signature verified correctly.
451 .BI "JUNK " type " " name
454 was found (as a result of the search requested by the
456 option), but it was not mentioned in the signature file and therefore
457 has not been checked.
460 Any other information.
462 The information written at the various verbosity levels is as follows.
464 No output. Watch the exit status.
466 exits zero if the signature was good.
473 messages are printed.
477 messages are printed describing reasons why the signature verification
480 message is printed showing the signature file's comment if any.
484 messages are shown listing the signing program's identification string,
485 the signing key, the signature and expiry dates, and actual signature
490 messages are printed for each file covered, showing its name and hash.
492 There are two output formats: textual and binary. The hash used in the
493 digital signature is always computed on the
495 version of the data, regardless of the external representation.
497 Within the file, whitespace and comments between strings are ignored. A
498 comment begins with a hash
500 and extends until the next newline.
502 Strings are either quoted or whitespace-delimited. A string may be
508 The end-quote character can be backslash-escaped within the string. An
509 occurrence of the unescaped end-quote character terminates the string.
510 A whitespace-delimited string is terminated by any unescaped whitespace
511 character. The C-language escape sequences
519 are recognized within either kind of string.
521 Blocks within the file consist of sequences of strings. The first
524 \(en a simple string ending in a colon
526 \(en which describes the format of the remaining strings.
528 The file consists of a sequence of blocks, each of which begins with a
529 tag byte. The format of the test of the block depends on the tag.
530 Strings are null-terminated; all integers are in network byte order.
532 A binary file always begins with an ident block, which has a tag of 0.
534 The following block types are known. They must appear in the order
535 given, and except where noted must appear exactly once each.
538 Identification string of the generating program.
540 The signing key's id, as eight hex digits (text) or a 32-bit integer
544 The comment string set with the
548 command. This block need not appear.
551 The date the signature was made. In a text file, this has the form
555 in a binary file, it's a 64-bit integer representing the POSIX time.
558 The expiry time of the signature, expressed as for
560 A non-expiring signature is represented by the string
562 in text files, or all-bits-set in binary.
565 A file hash. In text, this is two strings which are the Base-64-encoded
566 hash and the file name; in binary, this is a 16-bit hash length, the raw
567 hash, and the null-terminated filename. There can be any number of
571 .BR "signature: " (6)
572 The signature. In text, this is the Base-64-encoded signature; in
573 binary, it is a 16-bit length followed by the binary signature.
575 The signature covers the
577 representations of the file's
590 Mark Wooding, <mdw@distorted.org.uk>