<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/discussions/f/integrations/14180/aws-signature-4-sha256-key-hashing</link><description>Hi All, 
 I&amp;#39;ve been trying to sign an AWS Signature 4 http request using both the Java Cryptography Library plugin and the Cryptography tools plugin. The Appian code near the bottom is using the latter, but I&amp;#39;ve been getting the same results using the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/78731?ContentTypeID=1</link><pubDate>Thu, 31 Dec 2020 08:13:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b89ded06-4062-4bb2-a350-690ae5084df2</guid><dc:creator>jonbond0002</dc:creator><description>&lt;p&gt;Hi Tejas,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am getting signature error, when trying to do PUT request from Appian HTTP connected systems, But same key is working for GET request. Also when I am testing the PUT request in POSTMAN, it is working. Looks like &lt;span&gt;&lt;/span&gt;&lt;a href="https://docs.appian.com/suite/help/19.4/aws_signaturev4_authentication.html"&gt;AWS Signature Version 4 authentication&lt;/a&gt; have some issue.&lt;/p&gt;
&lt;p&gt;Can you please help me to resolve this issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/72756?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2020 08:41:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7334164c-f862-4964-85a8-c7f92a7fc0db</guid><dc:creator>sanin</dc:creator><description>&lt;p&gt;Thank you, now it works!&lt;/p&gt;
&lt;p&gt;However, description for Service field in Connected System Properties is somewhat misleading. It would be good to add something like:&lt;/p&gt;
&lt;p&gt;&amp;quot;The service namespace that identifies the AWS product. For example, &lt;code class="code"&gt;s3&lt;/code&gt; for Amazon S3 resources.&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/72726?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2020 15:54:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fd5a1014-3f79-40f3-9cab-599d6d138bc5</guid><dc:creator>Tejas Sakhardande</dc:creator><description>&lt;p&gt;Can you try using just &amp;quot;sqs&amp;quot; as the value of the service field?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/72725?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2020 15:49:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:11069105-3c8e-4a51-a062-508107bb95ee</guid><dc:creator>sanin</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;value is full ARN string:&amp;nbsp; &amp;quot;arn:aws:sqs:eu-central-1:XXXXXXXXXXXX:sqsname.fifo&amp;quot;&lt;/p&gt;
&lt;p&gt;I have replaced here my AWS account id with X&amp;#39;s.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/72718?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2020 13:37:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fca9affb-4252-4c16-b0e3-c85ce293a85f</guid><dc:creator>Tejas Sakhardande</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;Can you let me know what is the value of the &amp;#39;Service&amp;#39; field in your Connected System?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/72706?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2020 10:01:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8729cd61-fab6-4557-a5be-4365a7958c67</guid><dc:creator>sanin</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/tejas.sakhardande"&gt;Tejas Sakhardande&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;I am experiencing some difficulties connecting to AWS SQS using new AWS Signature Version 4 authentication.&lt;/p&gt;
&lt;p&gt;It looks like Service part of the signature (extracted from ARN) is not correct.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My ARN: arn:aws:sqs:eu-central-1:XXXXXXXXXXXX:sqsname.fifo&lt;/p&gt;
&lt;p&gt;The error message: &amp;lt;Error&amp;gt;&amp;lt;Type&amp;gt;Sender&amp;lt;/Type&amp;gt;&amp;lt;Code&amp;gt;SignatureDoesNotMatch&amp;lt;/Code&amp;gt;&amp;lt;Message&amp;gt;Credential should be scoped to correct service: &amp;#39;sqs&amp;#39;. &amp;lt;/Message&amp;gt;&amp;lt;Detail/&amp;gt;&amp;lt;/Error&amp;gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/70545?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2019 16:43:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:22c2c998-b7ab-4480-b0f6-91738e76a537</guid><dc:creator>Tejas Sakhardande</dc:creator><description>&lt;p&gt;&lt;span&gt;As an update to this post, we&amp;#39;re excited to announce that we&amp;#39;ve added support for&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.appian.com/suite/help/19.4/aws_signaturev4_authentication.html"&gt;AWS Signature Version 4 authentication&lt;/a&gt;&lt;span&gt;&amp;nbsp;to HTTP connected systems in Appian. You&amp;nbsp;should no longer&amp;nbsp;require the plugins in order to connect Appian to an Amazon service which uses the AWS Signature Version 4 authentication.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let us know if you have any questions or concerns!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/66806?ContentTypeID=1</link><pubDate>Wed, 22 May 2019 16:24:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:09511793-1119-4576-9613-656a7d5b947d</guid><dc:creator>Eliot Gerson</dc:creator><description>&lt;p&gt;Glad to hear the outbound call is working!! What sort of function would you need in order to decrypt the response?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;For the second part, I think you&amp;#39;re correct that you&amp;#39;ll still need authentication for any incoming calls to Appian that aren&amp;#39;t a direct response to a synchronous call.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/66800?ContentTypeID=1</link><pubDate>Wed, 22 May 2019 09:36:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5d0f1820-417d-49a3-97e0-f391c814a04e</guid><dc:creator>Rick Bekker</dc:creator><description>&lt;p&gt;It works, thanks for you help! For the response back from Buckaroo I also need to decrypt (un-hash) the message. And the new c&lt;span&gt;hallenge; they want to send a a-synchronized REST call back with the payment update without any basic authentication only with the hashed body, I&amp;#39;m trying to convince Buckaroo to use basic authentication.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65898?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 16:24:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a39bbeba-f65e-4609-b580-7b95901da413</guid><dc:creator>Eliot Gerson</dc:creator><description>&lt;p&gt;Sounds great! Version 2.3.0 should be available soon on the App Market and for deployment to cloud sites. That will have an &amp;quot;hmacsha256bytehash&amp;quot; method that will hopefully meet your needs (as well as a getAwsV4Signature, for those who needed an additional function to complete the aws workflow).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65885?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 11:04:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7091dbee-c759-4563-ac74-764cabd82869</guid><dc:creator>Rick Bekker</dc:creator><description>&lt;p&gt;I think the steps that Josh describes for me are correct. If we can have an addition on the current plugin that would be great.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65835?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 20:39:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8fa4d326-c6c5-4a61-8268-cd2b0d5901ef</guid><dc:creator>Eliot Gerson</dc:creator><description>&lt;p&gt;I think I should be able to add that capability to the cryptography hash plugin. I don&amp;#39;t want it to get too unwieldy, but at the same time, it seems nice to have these things in one centralized location, and by adding it to the app market plugin, it promotes easy reuse by other members of the community.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To that end, can you confirm that the four steps that Josh outlined sound like the right steps for you? If so, I&amp;#39;ll go ahead and add a function&amp;nbsp;that does what he described.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, I&amp;#39;ve updated the cryptography plugin with the last step of the AWS signature process, so if anyone is looking for that, keep an eye out for version 2.2.0 or above.&amp;nbsp; (&lt;a href="/members/jeffreyl946"&gt;jeffreyl946&lt;/a&gt;&amp;nbsp;, that will be the version that you probably want. once it&amp;#39;s ready, you can deploy it to your cloud sites via the admin console.)&amp;nbsp;I wound up making the method ever so slightly different than the example Josh gave, so you may need to modify your own SAIL code slightly if you&amp;#39;re using Josh&amp;#39;s as a reference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65833?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 17:19:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b1744848-e2b0-4b4d-ad49-29e1148de9a0</guid><dc:creator>Josh</dc:creator><description>&lt;p&gt;Looking at the code in the link Rick provided, it looks to be more simple than the AWS V4 signature.&amp;nbsp; Here&amp;#39;s the steps I see for the Buckaroo use case:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Convert the secretKey from string to byte array&lt;/li&gt;
&lt;li&gt;Convert the dataToSign from string to byte array&lt;/li&gt;
&lt;li&gt;Use secretKeyBytes to &amp;quot;sign&amp;quot; dataToSignBytes using hmacsha256 (output needs to be byte array).&lt;/li&gt;
&lt;li&gt;Convert signatureBytes to base64 encoded string (not a hex encoded string like awsV4)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;As for the AWS V4 Signature, here is the (verified working) class I came up with to produce the signature hex string.&amp;nbsp; This string then gets added to the authorization header in the actual request:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;package com.commute.aws.signature;

import java.util.Map;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;

import com.appiancorp.exceptions.InsufficientPrivilegesException;
import com.appiancorp.services.ServiceContext;
import com.appiancorp.suiteapi.common.exceptions.AppianException;
import com.appiancorp.suiteapi.common.exceptions.ErrorCode;
import com.appiancorp.suiteapi.expression.annotations.Category;
import com.appiancorp.suiteapi.expression.annotations.Function;
import com.appiancorp.suiteapi.expression.annotations.Parameter;
import com.appiancorp.suiteapi.security.external.SecureCredentialsStore;

@Category(&amp;quot;awsSignatureFunctionsCategory&amp;quot;)
public class AwsSignatureGenerator {

	private static final Logger LOG = Logger.getLogger(AwsSignatureGenerator.class);

	@Function
	public static String getAWSV4Signature(ServiceContext sc, SecureCredentialsStore scs,
			@Parameter String scsExternalSystemKey, @Parameter String scsFieldKey, @Parameter String dateStamp,
			@Parameter String regionName, @Parameter String serviceName, @Parameter String stringToSign)
			throws Exception {

		String key = getCryptoKey(scs, scsExternalSystemKey, scsFieldKey);

		/* 1. Get signature key */
		byte[] signatureKey = getSignatureKey(key, dateStamp, regionName, serviceName);
		/* 2. Calculate signature */
		byte[] signature = hmacSHA256(stringToSign, signatureKey);
		/* 3. Encode signature to hex string and return value */
		String stringHexSignature = bytesToHexString(signature);
		return stringHexSignature;
	}

	private static byte[] hmacSHA256(String data, byte[] key) throws Exception {
		String algorithm = &amp;quot;HmacSHA256&amp;quot;;
		Mac mac = Mac.getInstance(algorithm);
		mac.init(new SecretKeySpec(key, algorithm));
		return mac.doFinal(data.getBytes(&amp;quot;UTF-8&amp;quot;));
	}
	
	private static byte[] getSignatureKey(String key, String dateStamp, String regionName, String serviceName)
			throws Exception {
		byte[] kSecret = (&amp;quot;AWS4&amp;quot; + key).getBytes(&amp;quot;UTF-8&amp;quot;);
		byte[] kDate = hmacSHA256(dateStamp, kSecret);
		byte[] kRegion = hmacSHA256(regionName, kDate);
		byte[] kService = hmacSHA256(serviceName, kRegion);
		byte[] kSigning = hmacSHA256(&amp;quot;aws4_request&amp;quot;, kService);

		return kSigning;
	}
	
	private static String bytesToHexString(byte[] bytes) {
		StringBuilder sb = new StringBuilder();
		for (byte b : bytes) {
			sb.append(String.format(&amp;quot;%02x&amp;quot;, b));
		}
		return sb.toString();
	}

	private static String getCryptoKey(SecureCredentialsStore scs, String scsExternalSystemKey, String scsFieldKey)
			throws AppianException {
		if (StringUtils.isNotEmpty(scsExternalSystemKey)) {
			try {
				// Get Secure Credential Store
				Map&amp;lt;String, String&amp;gt; credentials = scs.getSystemSecuredValues(scsExternalSystemKey);
				if (!credentials.containsKey(scsFieldKey)) {
					LOG.error(&amp;quot;Field &amp;quot; + scsFieldKey + &amp;quot; does not exist in Secure Credential Store &amp;quot; + scsExternalSystemKey);
					throw new AppianException(ErrorCode.EXTERNAL_SYSTEM_CONFIGURATION_INVALID_ATTR_NAME, scsFieldKey);
				}
				// Return key
				return credentials.get(scsFieldKey);
			} catch (InsufficientPrivilegesException e) {
				throw new AppianException(ErrorCode.EXTERNAL_SYSTEM_NOT_FOUND_INSUFFICIENT_PRIVILEGES, e);
			}
		} else {
			throw new AppianException(ErrorCode.EXTERNAL_SYSTEM_NOT_FOUND_INSUFFICIENT_PRIVILEGES,
					scsExternalSystemKey);
		}
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;For creating the &amp;quot;string to sign&amp;quot;&amp;nbsp; here is the expression rule we are using:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;/* 
  Steps for creating an AWS V4 Signature:
    1. Create a Canonical Request: https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
       Canonical Request Format = 
        [HTTPMethod]\n
        [CanonicalURI]\n
        [CanonicalQueryString]\n
        [CanonicalHeaders]\n
        [SignedHeaders]\n
        [HashedPayload]
        
    2. Create a String to Sign: https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html
       StringToSign =
        Algorithm]\n
        [RequestDateTime]\n
        [CredentialScope]\n
        [HashedCanonicalRequest]
        
    3. Calculate the Signature: https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
    
    4. Create Authorization Header value: https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html
       [algorithm] Credential=[accessKeyId]/[credentialScope], SignedHeaders=[signedHeaders], Signature=[signature]
*/
with(
  local!dateStamp: rule!TRSY_formatXAmzDateTime(dateTime: ri!dateTime, isDateOnly: true),
  local!dateTimeStamp: rule!TRSY_formatXAmzDateTime(dateTime: ri!dateTime),
  /* CredentialScope = [dateStamp]/[aws-region]/[aws-service]/aws4_request */
  local!credentialScope: joinarray(
    {
      local!dateStamp,
      cons!TRSY_SQS_AWS_REGION,
      cons!TRSY_SQS_SERVICE_NAME,
      cons!TRSY_SQS_AWS_SIGNATURE_VERSION
    },
    &amp;quot;/&amp;quot;
  ),
  /* Step 1: Canonical request */
  local!canonicalRequest: with(
    local!hashedPayload: sha256hash(ri!body),
    local!headers: joinarray({
      &amp;quot;content-length:&amp;quot;&amp;amp;lenb(ri!body),
      &amp;quot;content-type:text/plain; charset=UTF-8&amp;quot;,
      &amp;quot;host:&amp;quot;&amp;amp;cons!TRSY_SQS_HOST,
      &amp;quot;x-amz-content-sha256:&amp;quot; &amp;amp; local!hashedPayload,
      &amp;quot;x-amz-date:&amp;quot; &amp;amp; local!dateTimeStamp
    }, char(10)),
    joinarray(
      {
        &amp;quot;POST&amp;quot;,
        cons!TRSY_SQS_URI,
        &amp;quot;Action=&amp;quot;&amp;amp;ri!actionParameter&amp;amp;&amp;quot;&amp;amp;MessageGroupId=&amp;quot;&amp;amp;ri!messageGroupIdParameter,
        local!headers&amp;amp;char(10),
        cons!TRSY_SQS_AWS_SIGNED_HEADERS,
        local!hashedPayload
      },
      char(10)
    )
  ),
  /* Step 2: String to sign */
  local!stringToSign: joinarray(
    {
      cons!TRSY_SQS_SIGNING_ALGORITHM,
      local!dateTimeStamp,
      local!credentialScope,
      sha256hash(local!canonicalRequest)
    },
    char(10)
  ),
  /* Step 3: Signature */
  local!signature: getawsv4signature(
    scsExternalSystemKey: cons!TRSY_SQS_SCSFIELD_EXTERNALFIELD, 
    scsFieldKey: cons!TRSY_SQS_SCSFIELD_FIELDNAME_SECRETACCESSKEY, 
    dateStamp: local!dateStamp, 
    regionName: cons!TRSY_SQS_AWS_REGION, 
    serviceName: cons!TRSY_SQS_SERVICE_NAME, 
    stringToSign:local!stringToSign
  ),
  /* Step 4: Authorization header value */
  concat(
    cons!TRSY_SQS_SIGNING_ALGORITHM,
    &amp;quot; &amp;quot;,
    joinarray(
      {
        &amp;quot;Credential=&amp;quot;&amp;amp;cons!TRSY_SQS_SECRET_ACCESS_KEY_ID&amp;amp;&amp;quot;/&amp;quot;&amp;amp;local!credentialScope,
        &amp;quot;SignedHeaders=&amp;quot;&amp;amp;cons!TRSY_SQS_AWS_SIGNED_HEADERS,
        &amp;quot;Signature=&amp;quot;&amp;amp;local!signature
      },
      &amp;quot;, &amp;quot;
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;TRSY_formatXAmzDateTime rule is just a helper to format the date/time into the format AWS&amp;nbsp;requires:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="javascript"&gt;//TRSY_formatXAmzDateTime
if( 
  or(
    rule!APN_isBlank(ri!isDateOnly),
    not(ri!isDateOnly)
  ),
  text(gmt(ri!dateTime), &amp;quot;yyyymmddThhmmss&amp;quot;)&amp;amp;&amp;quot;Z&amp;quot;,
  text(gmt(ri!dateTime), &amp;quot;yyyymmdd&amp;quot;)
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65832?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 16:00:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bd931360-000b-4d9e-9f28-bdd77de4092c</guid><dc:creator>Eliot Gerson</dc:creator><description>&lt;p&gt;Are you looking for a method that will take in a byte array (as the key) and a string (the value to sign), and return a hex string (using the byte array to sign the string)? Or are you also needing to generate the key itself?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;a href="/members/joshb"&gt;Josh&lt;/a&gt; , I&amp;#39;m trying to figure out if this is the same problem you were having. Can you tell? It seems like one possible solution (if I can do it) would be to 1) give a snippet of SAIL that would take a hex string and convert it to binary 2) add a hmacsha256(bytes, string) method that you could then pass that binary string to. Does that sound right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65814?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 08:01:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1ad2ef82-0503-487e-98dd-ece6dfe0b276</guid><dc:creator>Rick Bekker</dc:creator><description>&lt;p&gt;We are working on an integration with Buckaroo, Buckaroo needs a secret key in the header.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The key also need a hash on byte level, we are almost there in creating the expression but there is one problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The functionality that is missing is in the current crypto plugin is the hmcasha256 hash on byte level instead of string level.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Buckaroo documentation:&lt;/span&gt; &lt;a href="https://dev.buckaroo.nl/Apis/Description/json#codeexampleincsharp"&gt;&lt;span&gt;https://dev.buckaroo.nl/Apis/Description/json#codeexampleincsharp&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;example code C# line 63:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=" language-csharp line-numbers"&gt;&lt;code class="-rows js-code language-csharp"&gt;&lt;span class="token keyword"&gt;var&lt;/span&gt; secretKeyByteArray &lt;span class="token operator"&gt;=&lt;/span&gt; Encoding&lt;span class="token punctuation"&gt;.&lt;/span&gt;UTF8&lt;span class="token punctuation"&gt;.&lt;/span&gt;&lt;span class="token function"&gt;GetBytes&lt;/span&gt;&lt;span class="token punctuation"&gt;(&lt;/span&gt;SecretKey&lt;span class="token punctuation"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you help us or give us pointers regarding the hash?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65767?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 18:53:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fa5125de-83f4-4aa7-bd0e-f8af80482b40</guid><dc:creator>Eliot Gerson</dc:creator><description>&lt;p&gt;That&amp;#39;s great! One of the reasons we like to include the source code in our plugins is so that people can learn from them and build off them. I&amp;#39;m glad to hear you were able to do just that.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65765?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 18:28:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:72b6f8d5-1b8a-46eb-8991-a802b00149ce</guid><dc:creator>Josh</dc:creator><description>&lt;p&gt;In all honesty, I was a bit impatient and wasn&amp;#39;t sure if you would have time to make other changes, so I created my own plugin which basically does as you&amp;#39;ve described.&amp;nbsp; I modified the&amp;nbsp;getSignatureKey to be a private method that returns the byte array and then added a new&amp;nbsp;method for creating the signature, returning it as a hex encoded string.&amp;nbsp; I also added the use of secure credential store.&amp;nbsp; I&amp;#39;m still waiting for it to be deployed in our dev environment so I can test it fully.&amp;nbsp;Once I&amp;#39;ve tested it, I&amp;#39;d be happy to share the source code so you can implement it in the Cryptography&amp;nbsp; Hash Functions plugin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65764?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 18:13:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ff0ea2a1-109b-4790-934f-a0a7a49bf6d2</guid><dc:creator>Eliot Gerson</dc:creator><description>&lt;p&gt;Is there any point in the process where we get a result that isn&amp;#39;t a byte array? For example, once the string is signed, is it a string, or a byte array?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Basically, the challenge is that we do technically have a &amp;quot;binary&amp;quot; type in Appian, but it&amp;#39;s rather old, and we don&amp;#39;t have a type converter for it (which is why you can&amp;#39;t, for example, use it as the type for a rule input.) Adding support for that would require me to make a change at the product level, which would be a much more involved effort.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, the goal is to do all the byte operations in the plugin, and then return&amp;nbsp;some other type back, like a string.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;With that in mind, do you think it would work for you if the method had you additionally pass the text you want to sign, signed it with the&amp;nbsp;&lt;span&gt;hmacsha256hash function, and then returned the signed text (in... hex encoded form, I guess?)? Or does the signed text also need to remain in binary?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65756?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 14:52:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:949fdca3-6e1a-4d10-abdd-9de13aa8c7b0</guid><dc:creator>Josh</dc:creator><description>&lt;p&gt;Eliot,&lt;/p&gt;
&lt;p&gt;Thank you so much!&amp;nbsp; I&amp;#39;m using v2.0 of the plugin and the &lt;span&gt;getSignatureKey&amp;nbsp;function appears to work&amp;nbsp;as expected. There is a slight challenge though.&amp;nbsp; After numerous attempts, I was unable to produce a&amp;nbsp;signature that matched AWS samples.&amp;nbsp; After doing some more research, it appears the &amp;quot;string to sign&amp;quot; must be signed using the byte array of the signature key, not the hex string.&amp;nbsp; Here&amp;#39;s an example I found (look at the&amp;nbsp;&lt;/span&gt;&lt;span class="pln"&gt;calculateSignature method)&lt;/span&gt;&lt;span&gt;:&amp;nbsp;&lt;a href="https://www.javaquery.com/2016/01/aws-version-4-signing-process-complete.html"&gt;https://www.javaquery.com/2016/01/aws-version-4-signing-process-complete.html&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt; Would you have time to&amp;nbsp;update the plugin with that additional piece?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65695?ContentTypeID=1</link><pubDate>Sun, 07 Apr 2019 22:56:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8acad555-81a3-4050-a93f-0b17e7e77e0c</guid><dc:creator>jeffreyl946</dc:creator><description>&lt;p&gt;Thanks Eliot! This is really appreciated!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65691?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2019 23:52:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:eeb7a017-d69c-4c21-aac8-8e2998bee112</guid><dc:creator>Eliot Gerson</dc:creator><description>&lt;p&gt;Alright, so, final update for now: the 2.0.0 version, with the getSignatureKey method, should be available within 24 hours or so for download from the App Market, and/or installation to Cloud Sites through the Admin Console.&lt;br /&gt;&lt;br /&gt;The 2.1.0 release, which has support for the secure credentials store, will likely be available at some point on Monday or Tuesday.&lt;/p&gt;
&lt;p&gt;Once the plugin is installed, the function tooltip (the function will be &amp;quot;getSignatureKey&amp;quot;, under the cryptography functions category) should answer most questions, but if any questions or concerns do come up, just let me know.&amp;nbsp;&lt;a href="/members/jeffreyl946"&gt;jeffreyl946&lt;/a&gt;, fyi as well.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65688?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2019 22:12:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9149e2f8-2872-4604-8bfe-acf52668e12c</guid><dc:creator>Eliot Gerson</dc:creator><description>&lt;p&gt;The review is complete, but it might take a day or two for it to be available. So&amp;nbsp;I think it should show up for you at some point on Monday. If you have cloud sites, you&amp;#39;ll be able to add it through the Admin Console. Otherwise, you&amp;#39;ll be able to download it through the App Market, and then follow the normal instructions to install a plugin.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Also, I saw your comment on the plugin&amp;#39;s app market page asking about the secure credentials store. That&amp;#39;s good thinking, so I&amp;#39;m adding that capability to the plugin (just for the AWS signature function, for now, rather than for all the functions.) So, you&amp;#39;ll actually want version 2.1.0 .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65687?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2019 21:20:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1635a18d-2821-4e62-b4eb-2142dfbca968</guid><dc:creator>Eliot Gerson</dc:creator><description>&lt;p&gt;ah, my apologies. I&amp;#39;ve edited my previous comment so as to not confuse any future viewers.&amp;nbsp;The review process should be pretty quick, especially for something developed in-house, but I&amp;#39;ll double check to see where things are at.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65686?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2019 21:14:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bb2e8cc7-e0eb-4a7c-a064-4a1ff809800b</guid><dc:creator>Josh</dc:creator><description>&lt;p&gt;I&amp;#39;m not able to see any app submission.&amp;nbsp; I get an error when I try the link you provided.&amp;nbsp; My guess is I can only&amp;nbsp;see those that I submit.&amp;nbsp; How long does&amp;nbsp;the review process take?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS Signature 4 SHA256 Key Hashing</title><link>https://community.appian.com/thread/65685?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2019 20:49:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ec85e3e8-e55e-4c6a-b396-7ebe4d4ae483</guid><dc:creator>Eliot Gerson</dc:creator><description>&lt;p&gt;I went ahead and did it as an update to the cryptography hash functions plugin. The official update is technically pending review, but should be available soon.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>