Class CookieSigner
Methods Summary
- __construct ( $keyPairId, $privateKey )
-
getSignedCookie ( string $url = null, string|integer|null $expires = null, string $policy = null )
Create a signed Amazon CloudFront Cookie.
Methods Details
__construct ( $keyPairId, $privateKey )
Parameters
$keyPairId | ID of the key pair | |
$privateKey | Path to the private key used for signing |
Exceptions
RuntimeException if the openssl extension is missing |
InvalidArgumentException if the private key cannot be found. |
array getSignedCookie ( string $url = null, string|integer|null $expires = null, string $policy = null )
Create a signed Amazon CloudFront Cookie.
Parameters
string | $url = null | URL to sign (can include query string and wildcards). Not required when passing a custom $policy. |
string|integer|null | $expires = null | UTC Unix timestamp used when signing with a canned policy. Not required when passing a custom $policy. |
string | $policy = null | JSON policy. Use this option when creating a signed cookie for a custom policy. |
Returns
array The authenticated cookie parameters |
Exceptions
InvalidArgumentException if the URL provided is invalid |