1 Reply Latest reply on Nov 9, 2016 2:53 AM by Prakash Jain

    how to - hex bytes to SHA-256 hash in XQuery expression (Informatica Cloud Real-Time)

    New Member

      (requirement: copy an S3 file to another name based on the timestamp)


      attempting to call the AWS S3 ReST, one of the steps requires hashing the canonical request as described below

      "Append the hash of the canonical request that you created in Task 1: Create a Canonical Request for Signature Version 4. This value is not followed by a newline character. The hashed canonical request must be lowercase base-16 encoded, as defined by Section 8 of RFC 4648."

      Task 2: Create a String to Sign for Signature Version 4 - Amazon Web Services


      for example,

      Canonical Request=GET\n/\n\nhost:s3.amazonaws.com\nx-amz-date:20161023T2337321Z\nhost;x-amz-date\nUNSIGNED-PAYLOAD

      (where \n is char 10)


      i am able to convert to lowercase hexadecimal bytes (4745540a2f0a0a686f73743a73332e616d617a6f6e6177732e636f6d0a782d616d7a)

      but cannot get to the SHA-256 hash value (b74131c6027e3ecab98fc9c576327d9d2d3c86f10a4dc2f8b7bd40f85a4e3e34)

      i have attempted to use the XQuery hash:hash function


      the conversion from hex to hash is done correctly by this page



      is anyone able to suggest what expression i can use? bearing in mind the Informatica Cloud RealTime only supports certain XQuery functions