CloudFront签名的URL的最大到期时间是多少

时间:2019-04-17 08:58:29

标签: amazon-s3 amazon-cloudfront

我正在使用CloudFront从此doc生成签名URL,CloudFront签名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);

注意:它应该是永久网址,例如Instagram cdn URL

1 个答案:

答案 0 :(得分:1)

CloudFront签名的URL没有最长到期时间,但是您始终必须指定DateLessThan参数。

CloudFront要求使用此值,以防止用户永久访问您的私人内容。

要拥有类似永久性的网址,您应该在将来设置DateLessThan

另请参见When Does CloudFront Check the Expiration Date and Time in a Signed URL?Creating a Signed URL Using a Custom Policy

相关问题