Skip to content

Instantly share code, notes, and snippets.

@jz5
Created May 22, 2014 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jz5/d240691b29a402b7b12b to your computer and use it in GitHub Desktop.
Save jz5/d240691b29a402b7b12b to your computer and use it in GitHub Desktop.
diff --git a/Sample/src/SignedRequestHelper.cs b/Sample/src/SignedRequestHelper.cs
index 050e946..dec1058 100644
--- a/Sample/src/SignedRequestHelper.cs
+++ b/Sample/src/SignedRequestHelper.cs
@@ -31,6 +31,7 @@ namespace AmazonProductAdvtApi
{
private string endPoint;
private string akid;
+ private string associateTag;
private byte[] secret;
private HMAC signer;
@@ -49,11 +50,12 @@ namespace AmazonProductAdvtApi
* FR: ecs.amazonaws.fr
* CA: ecs.amazonaws.ca
*/
- public SignedRequestHelper(string awsAccessKeyId, string awsSecretKey, string destination)
+ public SignedRequestHelper(string awsAccessKeyId, string awsSecretKey, string destination, string associateTag)
{
this.endPoint = destination.ToLower();
this.akid = awsAccessKeyId;
this.secret = Encoding.UTF8.GetBytes(awsSecretKey);
+ this.associateTag = associateTag;
this.signer = new HMACSHA256(this.secret);
}
@@ -73,6 +75,7 @@ namespace AmazonProductAdvtApi
// Add the AWSAccessKeyId and Timestamp to the requests.
sortedMap["AWSAccessKeyId"] = this.akid;
sortedMap["Timestamp"] = this.GetTimestamp();
+ sortedMap["AssociateTag"] = this.associateTag;
// Get the canonical query string
string canonicalQS = this.ConstructCanonicalQueryString(sortedMap);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment