Has anyone using .net really developed how to successfully sign for use with CloudFront private content? After several days of trying, all I can get is Access Denied.
I worked with variations of the following code, and also tried to use OpenSSL.Net and AWSSDK, but it still does not have a sign method for RSA-SHA1.
The signature (data) is as follows:
{"Statement":[{"Resource":"http://xxxx.cloudfront.net/xxxx.jpg","Condition":{"DateLessThan":{"AWS:EpochTime":1266922799}}}]}
Update: All of this was fixed by deleting one place in the above signature.
If I had noticed this before!
This method attempts to sign a signature for use in a canned URL. Thus, the variations included the chanding padding used in has, as well as canceling the [] byte before signing, since OpenSSL does it this way.
public string Sign(string data) { using (SHA1Managed SHA1 = new SHA1Managed()) { RSACryptoServiceProvider provider = new RSACryptoServiceProvider(); RSACryptoServiceProvider.UseMachineKeyStore = false;
It is useful to note that I have verified that the content is correctly configured in S3 and CloudFront by creating the CloudFront canning policy URL using my CloudBerry Explorer. How do they do it?
Any ideas would be highly appreciated. Thanks
c # amazon rsa sha1 rsacryptoserviceprovider
Chet
source share