CloudFront的私人时间限制的URL [英] cloudfront private time limited url

查看:649
本文介绍了CloudFront的私人时间限制的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有想在网上卖教程视频客户端。我已经得到了他的教程由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

这篇关于CloudFront的私人时间限制的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆