Hi Guys,
I am working on producing a button that calls an xbasic function which generates a variable when the user clicks it on a row. That variable would then be available to produce a url that would be opened on the browser. I think I can get the variable back to the browser, but the trouble I am having is figuring out how to properly write the function. That being said, the variable I am trying to produce is as follows...
Ultimately we are trying to produce a code that is a shared access key generator for Windows Azure.
***
StringToSign = r + \n
2009-02-09 + \n
2009-02-10 + \n
/myaccount/pictures + \n
YWJjZGVmZw== + \n
2012-02-12
HMAC-SHA256(URL.Decode(UTF8.Encode(StringToSign))) = dD80ihBh5jfNpymO5Hg1IdiJIEvHcJpCMiCMnN/RnbI=
This was taken from http://msdn.microsoft.com/en-us/libr.../dn140256.aspx there is also a method via javascript here http://www.kongsli.net/nblog/2011/03...ng-javascript/ but I am trying to do this in xbasic server side as the security note of the javascript method could leave the critical key information vulnerable.
***
I expect the code would go something like...
function azure_sas_url as v (e as p)
StringToSign = r + \n
date() + \n
date() + \n
e.rowData.filename + \n
e.rowData.sigId== + \n
2012-02-12
'The 2012-02-12 is a signed version date
azure_sas_url = hmac_hash(urldecode( --? 'This is where I seem to loose what I am trying to do
Any thoughts on how I would accomplish this in Xbasic? I know the hmac_hash fuction and url decode functions are inside Alpha what other functions would I use to accomplish this to the exact method that Azure would require. This is similar to Amazon S3 also.
Thanks for any help.
I am working on producing a button that calls an xbasic function which generates a variable when the user clicks it on a row. That variable would then be available to produce a url that would be opened on the browser. I think I can get the variable back to the browser, but the trouble I am having is figuring out how to properly write the function. That being said, the variable I am trying to produce is as follows...
Ultimately we are trying to produce a code that is a shared access key generator for Windows Azure.
***
StringToSign = r + \n
2009-02-09 + \n
2009-02-10 + \n
/myaccount/pictures + \n
YWJjZGVmZw== + \n
2012-02-12
HMAC-SHA256(URL.Decode(UTF8.Encode(StringToSign))) = dD80ihBh5jfNpymO5Hg1IdiJIEvHcJpCMiCMnN/RnbI=
This was taken from http://msdn.microsoft.com/en-us/libr.../dn140256.aspx there is also a method via javascript here http://www.kongsli.net/nblog/2011/03...ng-javascript/ but I am trying to do this in xbasic server side as the security note of the javascript method could leave the critical key information vulnerable.
***
I expect the code would go something like...
function azure_sas_url as v (e as p)
StringToSign = r + \n
date() + \n
date() + \n
e.rowData.filename + \n
e.rowData.sigId== + \n
2012-02-12
'The 2012-02-12 is a signed version date
azure_sas_url = hmac_hash(urldecode( --? 'This is where I seem to loose what I am trying to do
Any thoughts on how I would accomplish this in Xbasic? I know the hmac_hash fuction and url decode functions are inside Alpha what other functions would I use to accomplish this to the exact method that Azure would require. This is similar to Amazon S3 also.
Thanks for any help.
Comment