Skip to Content

HMAC-SHA1 Generator

Introduction

The HMAC-SHA1 Generator plugin generates a message signature using the SHA-1 hash function. The signature is returned as a hex-encoded string in the output variable Jitterbit.HMACSHA1.Signature.

This plugin is available by default on Jitterbit Cloud Agent Groups and can also be associated with Private Agent Groups.

Important

Plugins provided by Jitterbit are deprecated. See Deprecation and Support in Plugins.

Versions

The current version of the plugin is 1.1.1. Prior versions of the plugin may also be in use:

  • 1.1.1: Runs under Linux systems in addition to Microsoft Windows.
  • 1.1.0: Accepts special characters such as carriage returns in keys and messages. Adds support for base64-encoded keys and messages.
  • 1.0.0: Initial version.

Download and Add the Plugin

The HMAC-SHA1 Generator plugin is a standard Jitterbit plugin that is already available in the Management Console Plugins page and does not need to be downloaded or added to the organization.

If directed by Jitterbit Support, this plugin can be downloaded at the links provided below and added to the organization (see Add New Plugins in Customizations > Plug-ins).

Associate the Plugin with an Agent Group

Versions 1.1.1.0 and 1.0.0.0 of the HMAC-SHA1 Generator plugin are associated with Jitterbit Cloud Agent Groups by default. We recommend using version 1.1.1.0.

If using a Private Agent Group, before you can use the plugin you must associate it with the Private Agent Group to make the plugin available on all agents in the group (see Associate Agent Groups in Customizations > Plug-ins).

The plugin is listed in the Management Console Plugins page with a display name of Jitterbit HMAC-SHA1 Generator.

Set Variables and Use the Plugin in a Project

Refer to these topics for information about using plugins in a project:

To use the HMAC-SHA1 Generator plugin, any required global variables must be set in a script for use with the plugin. The input table below documents all possible variables for this plugin. The output table documents the signature variable output by the plugin.

Input

Name Type Required Description
Jitterbit.HMACSHA1.Key String Required The secret key.
Jitterbit.HMACSHA1.Message String Required The message for which to create a signature.
Jitterbit.HMACSHA1.Encoding String Optional The encoding to use when translating the key and message to bytes. For example: UTF-8 or ISO-8859-1. If this value is not set, both the key and the message are assumed to be US-ASCII.

Jitterbit.HMACSHA1.Base64EncodedKey


Boolean Optional

Set to true for base64-encoded keys. The default is false. If set to true, the value in the Jitterbit.HMACSHA1.Key variable is treated as a base64-encoded value.

Note

Available in version 1.1 and later.

Jitterbit.HMACSHA1.Base64EncodedMessage

Boolean Optional

Set to true for base64-encoded messages. The default is false. If set to true, the value in the Jitterbit.HMACSHA1.Message variable is treated as a base64-encoded value.

Note

Available in version 1.1 and later.

Output

Name Type Description
Jitterbit.HMACSHA1.Signature String The variable returns the signature as a hex-encoded string.

Example

This example script both sets the variables used as input for the HMAC-SHA1 Generator plugin, as well as runs the plugin.

<trans>
// Clear result:
$Jitterbit.HMACSHA1.Signature = "";

$Jitterbit.HMACSHA1.Key = "dGVzdA==";
$Jitterbit.HMACSHA1.Message = "Test";
$Jitterbit.HMACSHA1.Encoding = "UTF-8"; // optional
$Jitterbit.HMACSHA1.Base64EncodedKey = true;
$Jitterbit.HMACSHA1.Base64EncodedMessage = false;
eval(RunPlugin("<TAG>plugin:http://www.jitterbit.com/plugins/pipeline/user/HMACSHA1Generator</TAG>"), $error=GetLastError());
WriteToOperationLog("HMAC Signature: " + $Jitterbit.HMACSHA1.Signature);
</trans>

The result of running this script is HMAC Signature: 09106d4568a1c1205e900980482f932f170020b7.