The Hash Transformer can be used to calculate a hash value.
The Hash Module contains an encoder that receives Mule Messages from the Mule Project and calculates a hash value.
Hash Encode Module
The Hash Encode operation allows you to compute a hash using various algorithms. To use the Hash Module, simply select an Algorithm. The module will compute a hash over the data in the incoming message payload at runtime.
If using an HMAC algorithm, you will also need to set the Key property to the secret key for the hash computation.
To hex encode the hash value set EncodeHash to True.
Add a File Read connector in front of the Hash Encode Module and configure it to read a particular target file. Select an Algorithm for the Encode operation. That is all that is required to hash the file. The calculated hash is written to the message payload.
Add a Set Payload Transformer in front of the Hash Encode Module and set the message payload to a string. Select an Algorithm for the Encode operation. That is all that is required to hash the string. The calculated hash is written to the message payload.
Encoder Property List
The following is the full list of the properties of the encoder Module with short descriptions. Click on the links for further details.
|Algorithm||The algorithm used to create the hash.|
|EncodeHash||Whether the hash value is hex encoded.|
|Key||The secret key for the hash algorithm.|
|Other||Defines a set of configuration settings to be used by the transformer.|
|RuntimeLicense||Specifies the component runtime license key.|
The following is a list of config settings for the Module with short descriptions. Click on the links for further details.
Algorithm Property (Hash Module)
The algorithm used to create the hash.
This property specifies the algorithm used to create the hash. Possible values are:
|2 (haSHA256 - default)||SHA-256|
|17 (haSHA3_224)||SHA-3-224 (originally known as Keccak)|
|18 (haSHA3_256)||SHA-3-256 (originally known as Keccak)|
|19 (haSHA3_384)||SHA-3-384 (originally known as Keccak)|
|20 (haSHA3_512)||SHA-3-512 (originally known as Keccak)|
EncodeHash Property (Hash Module)
Whether the hash value is hex encoded.
This property specifies whether the computed hash value is hex encoded. When set to True (default) the connector will hex encoded the computed hash for easier use. Set this value to False to obtain the hash value in an unmodified form.
The default value is True.
Key Property (Hash Module)
The secret key for the hash algorithm.
This property holds the secret key used when creating the hash. The key can be arbitrarily long.
Note: This property is only applicable when Algorithm is set to an HMAC algorithm.
Other Property (Hash Module)
Defines a set of configuration settings to be used by the transformer.
The module accepts one or more configuration settings. These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the module, access to these internal properties is provided through the Other property.
The Other property may be set to one or more configuration settings (name/value pairs). Set one setting per line.
RuntimeLicense Property (Hash Module)
Specifies the component runtime license key.
You can use the RuntimeLicense property to set the runtime key for the connector license.