UrlSigner
in package
Creates signed URLs for Amazon CloudFront resources.
Table of Contents
Methods
- __construct() : mixed
- getSignedUrl() : string
- Create a signed Amazon CloudFront URL.
Methods
__construct()
public
__construct( $keyPairId, $privateKey) : mixed
Parameters
- $keyPairId :
-
string ID of the key pair
- $privateKey :
-
string Path to the private key used for signing
Tags
getSignedUrl()
Create a signed Amazon CloudFront URL.
public
getSignedUrl(string $url[, string|int|null $expires = null ][, string $policy = null ]) : string
Keep in mind that URLs meant for use in media/flash players may have different requirements for URL formats (e.g. some require that the extension be removed, some require the file name to be prefixed
- mp4:
, some require you to add "/cfx/st" into your URL).
Parameters
- $url : string
-
URL to sign (can include query string string and wildcards)
- $expires : string|int|null = null
-
UTC Unix timestamp used when signing with a canned policy. Not required when passing a custom $policy.
- $policy : string = null
-
JSON policy. Use this option when creating a signed URL for a custom policy.
Tags
Return values
string —The file URL with authentication parameters