我正在使用 CloudFront 从中生成签名 URLdoc https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CFPrivateDistJavaDevelopment.htmlCloudFront 签名 URL 的最长过期时间是多少?我应该如何提及这个 DateLessThan 论点
示例代码片段
String signedUrlCanned = CloudFrontService.signUrlCanned(
"http://" + distributionDomain + "/" + s3ObjectKey, // Resource URL or Path
keyPairId, // Certificate identifier,
// an active trusted signer for the distribution
derPrivateKey, // DER Private key data
ServiceUtils.parseIso8601Date("2011-11-14T22:20:00.000Z") // DateLessThan
);
System.out.println(signedUrlCanned);
Note:它应该是一个永久 URL,如 Instagram cdn URL
CloudFront 签名 URL 没有最长过期时间,但您始终必须指定DateLessThan
范围。
CloudFront 需要此值来防止用户永久访问您的私有内容。
为了拥有类似永久的 URL,您应该设置DateLessThan
遥远的未来。
另请参阅CloudFront 何时检查签名 URL 中的到期日期和时间? https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls.html#private-content-check-expiration and 使用自定义策略创建签名 URL https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.html#private-content-custom-policy-statement-values
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)