Test -hash utility

From Messaging Server Technical Reference Wiki
Jump to: navigation, search

Test generating a hash of a string or of file contents.


  imsimta test -hash hash-name [file-name] 

imsimta test -hash Command Switches
Switch Default
-string=string -nostring
-repetitions=n None
-key=key None
-relaxed -norelaxed
-encoding=string -encoding=hexadecimal



Required parameter specifying the hash function to use. Valid values are MD2, MD4, MD5, SHA1, SHA256, SHA512, MD128, or MD160.


Optional parameter specifying the name of a file whose contents to input to the hash function. The -string switch may not be used if a file is specified.


The imsimta test -hash utility generates a hash of string or file input encoded in the specified encoding This is useful when testing the MTA's ability to generate message hashes, a feature useful for message archiving purposes.


-string=string, -nostring (default)

-stringmay not be specified if a file-name parameter has been supplied.


If specified, switches to computing an HMAC with the specified key. May only be used when a string is being hashed (-string), not when a file is specified.


May only be used when a string is being hashed (-string), not when a file is specified. The string is presented to the hash function the specified number of times. The default is a single repetition.

-relaxed, -norelaxed (default)

If specified, performs DKIM relaxed body canonicalization on the file input. A file input must be used.


New in MS Specifies the encoding used when the hash value is output. Hexadecimal is the default.


# ./imsimta test -hash -string="just a test" SHA1
Hash value: E6F36746CCBA42C288ACF906E636BB278EAEB7E8 

In the above example, a hash of the string "just a test" is generated using the SHA-1 hash function.

See also: