CloudFront的私人时间限制的URL私人、时间、CloudFront、URL

由网友(孽)分享简介:我有想在网上卖教程视频客户端。我已经得到了他的教程由CF流previews(这是公开的)。现在我想用C#SDK来产生的私人时间限制的网址,让谁购买教程客户下载他们在有限的时间段。一旦付款已得到确认,我想生成一个网址,并通过电子邮件发送给客户端。I have a client that wants to sell t...

我有想在网上卖教程视频客户端。我已经得到了他的教程由CF流previews(这是公开的)。现在我想用C#SDK来产生的私人时间限制的网址,让谁购买教程客户下载他们在有限的时间段。 一旦付款已得到确认,我想生成一个网址,并通过电子邮件发送给客户端。

I have a client that wants to sell tutorial videos online. I already got previews of his tutorials streaming from CF (This is public). Now I want to use the c# sdk to generate private, time limited URLs to allow customers who purchased the tutorials to download them for a limited time period. Once the payment has been confirmed, I want to generate a URL and send it to the client via email.

请问CF / .NET SDK的支持呢? 有人点我一个样本。我已搜查谷歌,并得到了很少的信息过载。不同的例子来自不同版本的SDK /管理控制台。请帮我做这一切的感觉:)

Does CF/.NET SDK support this? Can someone point me at a sample. I have searched Google, and got a little information overload. Different examples from different versions of sdk/management console. Please help me make sense of it all :)

推荐答案

如果你看一下类Amazon.CloudFront.AmazonCloudFrontUrlSigner有辅助方法创建presigned网址为私人分布。例如,这code段创建一个URL,它是有效期为一天。

If you look at the class Amazon.CloudFront.AmazonCloudFrontUrlSigner that has helper methods for creating presigned URL to private distributions. For example this code snippet creates a url that is valid for one day.

var url = AmazonCloudFrontUrlSigner.GetCannedSignedURL(AmazonCloudFrontUrlSigner.Protocol.http, domainName, cloudFrontPrivateKey, file, cloudFrontKeyPairID, DateTime.Now.AddDays(1));

有在那类其他实用的方法加入更多的具体的访问规则。

There are other utility methods in that class for adding more specific access rules.

请注意这个类中添加了SDK的1.5.2.0版本,后者于后期Augest

Note this class was added in version 1.5.2.0 of the SDK which came out in late Augest

阅读全文

相关推荐

最新文章