Skip to end of metadata
Go to start of metadata

Introduction

HMAC-SHA1 Generator plugin is used to generate a message signature using the SHA-1 hash function. The signature is returned as a hex-encoded string in the output variable Jitterbit.HMACSHA1.SignaturePrivate Agent and Cloud Agent groups are supported for this plugin.

Global Variables

To use this 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

NameTypeRequiredDescription
Jitterbit.HMACSHA1.KeystringRequiredThe secret key.
Jitterbit.HMACSHA1.MessagestringRequiredThe message for which to create a signature.
Jitterbit.HMACSHA1.EncodingstringOptionalThe 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 will be assumed to be US-ASCII.

Jitterbit.HMACSHA1.Base64EncodedKey


booleanOptional 

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

booleanOptional

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

NameTypeDescription

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.

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: Accepts special characters such as carriage returns in keys and messages. Adds support for base64-encoded keys and messages.
  • 1.0: Initial version.