Documentation

CookieSigner
in package

Table of Contents

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

Properties

$schemes

private static mixed $schemes = ['http' => true, 'https' => true]

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.

Return values
mixed

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

validateUrl()

private validateUrl(mixed $url) : mixed
Parameters
$url : mixed
Return values
mixed

Search results