Amazon SimpleDB Signature

Just starting out? Need help? Post your questions and find answers here.
giammy
User
User
Posts: 16
Joined: Wed Aug 03, 2011 10:43 am

Amazon SimpleDB Signature

Post by giammy »

Dear all,
i have a problem

I have tried to use the code in this post (http://www.purebasic.fr/english/viewtop ... 12&t=46460) for Amazon SimpleDb Autentication with success.

Amazon require a signature:
Signature = Base64( HMAC-SHA1( UTF-8-Encoding-Of( YourSecretAccessKeyID, StringToSign ) ) )


I don't understand the code but it dows work!
Code:
*i=AllocateMemory(20)
For x=1 To 20:PokeB(*i+x-1,Val("$"+Mid(two,(x*2)-1,2))):Next

why this? it does work with only 20 bytes (hmac sha1 returns a 40 bytes string)

Thanks in advance