SDK for PHP 3.x

CookieSigner
in package

Table of Contents

Methods

__construct()  : mixed
getSignedCookie()  : array<string|int, mixed>
Create a signed Amazon CloudFront Cookie.

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
throws
RuntimeException

if the openssl extension is missing

throws
InvalidArgumentException

if the private key cannot be found.

getSignedCookie()

Create a signed Amazon CloudFront Cookie.

public getSignedCookie([string $url = null ][, string|int|null $expires = null ][, string $policy = null ]) : array<string|int, mixed>
Parameters
$url : string = null

URL to sign (can include query string and wildcards). Not required when passing a custom $policy.

$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 cookie for a custom policy.

Tags
throws
InvalidArgumentException

if the URL provided is invalid

link
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html
Return values
array<string|int, mixed>

The authenticated cookie parameters

On this page