Checking with digestercli and Ant

Checking with digestercli

The Digester software also supports checking from the command-line. You can pass files, directories, or network files to be processed. In theory, all checking operations of the graphical program version can also be done using digestercli, so the software can be called from shell scripts for example.

You can either create your program calls manually or let the Digester GUI version assemble the necessary parameters for you. In the latter case, please configure a checking operation with the check window as if you would do some checking from there. Once all options are as desired, let the window assemble an appropriate digestercli call by pressing the console symbol at the bottom. This snippet can be easily copied into your own scripts.

All supported options can be passed in any order, but the corresponding values ​​must be in place. All arguments are optional, input errors are detected as far as possible and compensated automatically. Either the program reports incorrect arguments directly or creates appropriate entries in the log file. You can pass files, directories, or URLs to be processed as a space-separated list using the -targets argument.

The command-line version of the Digester software currently provides support for the following arguments and values, which may be printed by calling the application using digestercli -? check:

 

Usage: digestercli [-options] -targets <file|directory|url> ...

Supported check mode options include:

-check                          check message digest files
-checkbsd                       check for BSD files
-checkgnu                       check for GNU files
-checkintermediates             check intermediate message digests
-checkpgp                       check for PGP signature files
-checkxml                       check for Digester XML files
-checkxmlpgp                    check for Digester XML file signatures
-download                       download URLs and check, checked directly otherwise
-downloaddir <value>            directory to store downloads
-extmd2 <value>                 file extension for MD2
-extmd4 <value>                 file extension for MD4
-extmd5 <value>                 file extension for MD5
-extpgp <value>                 file extension for PGP signatures
-extripemd128 <value>           file extension for RIPEMD-128
-extripemd160 <value>           file extension for RIPEMD-160
-extripemd256 <value>           file extension for RIPEMD-256
-extripemd320 <value>           file extension for RIPEMD-320
-extsha1 <value>                file extension for SHA-1
-extsha224 <value>              file extension for SHA-224
-extsha256 <value>              file extension for SHA-256
-extsha384 <value>              file extension for SHA-384
-extsha512 <value>              file extension for SHA-512
-exttiger <value>               file extension for Tiger
-extwhirlpool <value>           file extension for Whirlpool
-extxml <value>                 file extension for Digester XML
-ignoreregex <value>            regular expression for files to be ignored
-includeregex <value>           regular expression for files to be included
-md2                            process MD2 message digests
-md4                            process MD4 message digests
-md5                            process MD5 message digests
-overwrite                      overwrite existing files
-pgpkeydownload                 automatically download unknown PGP keys
-pgpkeyignore                   ignore signatures for unknown PGP keys
-pgpkeyinstall                  install downloaded PGP keys permanently
-ripemd128                      process RIPEMD-128 hash files
-ripemd160                      process RIPEMD-160 hash files
-ripemd256                      process RIPEMD-256 hash files
-ripemd320                      process RIPEMD-320 hash files
-sha1 | sha                     process SHA-1 hash files
-sha224                         process SHA-224 hash files
-sha256                         process SHA-256 hash files
-sha384                         process SHA-384 hash files
-sha512                         process SHA-512 hash files
-stoponmismatch                 stop calculation on intermediate mismatch
-subdirectories                 include subdirectories
-tiger                          process Tiger hash files
-verbose                        print additional messages
-whirlpool                      process Whirlpool hash files

 

-check

Activate the operation mode to check digests and OpenPGP signatures. The arguments basically are the same as the options shown by the check window of the graphical version of the Digester software.

If the parameters described below are missing, then the check window defaults will be used where possible.You can list the currently used arguments and values with the -verbose parameter.

-checkbsd

Activates the checking of digest files in BSD format where the files are recognized based on the configured file extensions (see parameters -extmd2, -extmd4 , -extmd5 etc.).

-checkgnu

Activates the checking of digest files in GNU format where the files are recognized based on the configured file extensions (see parameter -extmd2, -extmd4 , -extmd5 etc.).

-checkintermediates

Intermediate digests are checked if this parameter is specified. Optionally the program can be automatically terminated when a mismatch of the calculated digests and the file digests has been detected (see parameter -stoponmismatch).

-checkpgp

Activates the checking of OpenPGP signature files for directory based checking where the files are recognized based on the configured file extensions (see parameter -extpgp).

-checkxml

Activates the checking of Digester XML files containing digests/signatures for directory based checking where the files are recognized based on the configured file extensions (see parameter -extxml ).

-checkxmlpgp

Activates the checking of OpenPGP signatures found in Digester XML files. Here, the recognition of XML files must be activated as well (see parameter -checkxml) and at least one XML file extension needs to be configured (see parameter -extxml).

-download

Activates the download of network resources which have been passed on the command-line and are to be checked (see parameter -downloaddir and -overwrite). The URLs will be downloaded into the configured directory in the first step and then checked in the second step. If this parameter is missing, then URLs are checked directly on the target system, which can be also done using the check functionality from within the network file system window.

The download of OpenPGP keys can be controlled with the -pgpkeydownload, -pgpkeyignore and -pgpkeyinstall parameters.

-downloaddir <value>

Sets the directory to save downloaded files. This directory is used for downloaded OpenPGP keystore files or URLs which have been downloaded for checking automatically (see parameter -download and -overwrite).

-extmd2 <value>

Sets the file extensions for GNU/BSD files containing MD2 message digests (default: .md2). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extmd4 <value>

Sets the file extensions for GNU/BSD files containing MD4 message digests (default: .md4). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extmd5 <value>

Sets the file extensions for GNU/BSD files containing MD5 message digests (default: .md5). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extpgp <value>

Sets the file extensions for signature files containing OpenPGP signatures (default: .asc .sig ). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extripemd128 <value>

Sets the file extensions for GNU/BSD files containing RIPEMD-128 message digests (default: .rip128). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extripemd160 <value>

Sets the file extensions for GNU/BSD files containing RIPEMD-160 message digests (default: .rip160). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extripemd256 <value>

Sets the file extensions for GNU/BSD files containing RIPEMD-256 message digests (default: .rip256). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extripemd320 <value>

Sets the file extensions for GNU/BSD files containing RIPEMD-320 message digests (default: .rip320). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extsha1 <value>

Sets the file extensions for GNU/BSD files containing SHA-1 message digests (default: .sha -sha1). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extsha224 <value>

Sets the file extensions for GNU/BSD files containing SHA-224 message digests (default: .sha224). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extsha256 <value>

Sets the file extensions for GNU/BSD files containing SHA-256 message digests (default: .sha256). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extsha384 <value>

Sets the file extensions for GNU/BSD files containing SHA-384 message digests (default: .sha384). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extsha512 <value>

Sets the file extensions for GNU/BSD files containing SHA-512 message digests (default: .sha512). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-exttiger <value>

Sets the file extensions for GNU/BSD files containing Tiger message digests (default: .tiger). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extwhirlpool <value>

Sets the file extensions for GNU/BSD files containing Whirlpool message digests (default: .wpool). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-extxml <value>

Sets the file extensions for Digester XML files containing digests/signatures (default: .digest). You can setup multiple file extensions with a space-separated list here. Please do not use the following characters: \ / : * ? " < > |

-ignoreregex <value>

Sets a regular expression to ignore certain files when searching for digests/signatures (not processed). Alternatively you can include certain files using the parameter -includeregex.

-includeregex <value>

Sets a regular expression to include certain files when searching for digests/signatures (are being processed). Alternatively you can ignore certain files using the parameter -ignoreregex.

-md2

Activates the recognition of GNU/BSD files containing MD2 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extmd2).

-md4

Activates the recognition of GNU/BSD files containing MD4 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extmd4).

-md5

Activates the recognition of GNU/BSD files containing MD5 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extmd5 ).

-overwrite

Existing files are overwritten, if downloaded files are to be stored into the configured download directory (see parameters -download and -downloaddir).

You will not be able to restore overwritten download files with the program, please backup your data first.

-pgpkeydownload

Activates the automatic download of OpenPGP keys into the download directory (see parameters -downloaddir and -overwrite). Network addresses for the download of keystore files are only supported by the Digester XML format.

OpenPGP keys are downloaded when required keys are not yet available within the key management of the Digester software (unknown). If downloaded keys shall be imported permanently you can additionally use the -pgpkeyinstall parameter. In order to ignore unknown keys please set the -pgpkeyignore argument.

The download of network resources for checking can be controlled with the -download parameter.

-pgpkeyignore

Unknown OpenPGP keys are simply ignored (no download). Signatures cannot be calculated and checked then. In this case, the required keys must be installed manually for example using the key management functionality of the Digester software. In order to download unknown keys automatically, please set the -pgpkeydownload instead and consider specifying the -pgpkeyinstall parameter as well.

-pgpkeyinstall

Downloaded keys are being installed permanently into the key management functionality of the Digester software. Those keys become directly available for the next checks (no downloads). In order to download unknown keys automatically, the -pgpkeydownload argument must be set, too.

-ripemd128

Activates the recognition of GNU/BSD files containing RIPEMD-128 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extripemd128).

-ripemd160

Activates the recognition of GNU/BSD files containing RIPEMD-160 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extripemd160).

-ripemd256

Activates the recognition of GNU/BSD files containing RIPEMD-256 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extripemd256).

-ripemd320

Activates the recognition of GNU/BSD files containing RIPEMD-320 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extripemd320).

-sha1 | sha

Activates the recognition of GNU/BSD files containing SHA-1 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extsha1).

-sha224

Activates the recognition of GNU/BSD files containing SHA-224 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extsha224).

-sha256

Activates the recognition of GNU/BSD files containing SHA-256 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extsha256).

-sha384

Activates the recognition of GNU/BSD files containing SHA-384 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extsha384).

-sha512

Activates the recognition of GNU/BSD files containing SHA-512 digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extsha512).

-stoponmismatch

Terminates the checking if a mismatch of the calculated intermediate digests and the file intermediates is detected (see parameter -checkintermediates). The other algorithms will then not be calculated as well.

-subdirectories

Activates the processing of subdirectories for directory-based checking. Otherwise only the specified directories themselves (without subdirectories) are being processed.

-tiger

Activates the recognition of GNU/BSD files containing Tiger digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -exttiger).

-verbose

Create more detailed messages. Especially all passed arguments and values are presented as a list for control purposes. For many program settings defaults are being used if a parameter is not specified. This functionality is useful if templates are used as default values where the current settings are to be controlled right before the processing starts.

-whirlpool

Activates the recognition of GNU/BSD files containing Whirlpool digests for directory-based checking where the files are recognized based on the configured file extensions (see parameter -extwhirlpool).

 

Checking with Ant

The Digester software also supports checking from Ant build scripts. You can pass files, directories, or network files to be processed. In theory, all check operations of the graphical program version can also be done using Apache Ant, so the software can be called from own builds scripts for example.

You can either create your XML tags manually or let the Digester GUI version assemble the necessary elements and attributes for you. In the latter case, please configure a check operation with the check window as if you would do some checking from there. Once all options are as desired, let the window assemble an appropriate Ant build script code by pressing the ant symbol at the bottom. This snippet can be easily copied into your own build scripts.

All supported options can be passed in any order, but the corresponding values ​​must be in place. All arguments are optional, input errors are detected as far as possible and compensated automatically. The program reports incorrect arguments directly and terminates if you have specified the failonerror tag.

For the checking with Ant all arguments of the command-line version of the Digester software digestercli can be used which are represented by separate XML elements each. In the header of your build script the task digestercli must be declared. Please adjust the classpath attribute by the value appropriate for your installation. The Web Start version cannot be used for checking from Ant build scripts.

<taskdef name="digestercli"
   classname="com.lf.digester.ant.DigesterCLITask"
   classpath="C:\Programme\digester-1.6.3\ant\digester-ant.jar"/>

An example XML code for Ant build scripts looks like the following where a single Digester XML file is being checked:

<digestercli>
   <check />
   <checkxml />
   <extxml>.digest</extxml>
   <checkxmlpgp />
   <checkintermediates />
   <stoponmismatch />
   <pgpkeyignore />
   <fileset dir="D:\checksum_test">
       <include name="jnlp-1_5-mr-spec.pdf.digest" />
   </fileset>
</digestercli>

 

Additional Links