CookieSigner
in package
Table of Contents
Methods
- __construct() : mixed
- getSignedCookie() : array<string|int, mixed>
- Create a signed Amazon CloudFront Cookie.
Methods
__construct()
public
__construct(string $keyPairId, string $privateKey[, int|string $algorithm = Signer::DEFAULT_ALGORITHM ]) : mixed
Parameters
- $keyPairId : string
-
ID of the key pair.
- $privateKey : string
-
Path to the private key used for signing, or a PEM-encoded key string.
- $algorithm : int|string = Signer::DEFAULT_ALGORITHM
-
Signing hash algorithm. Accepts either an OpenSSL constant (OPENSSL_ALGO_SHA1, OPENSSL_ALGO_SHA256) or the canonical name string ("SHA1", "SHA256"). Defaults to SHA1.
Tags
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
Return values
array<string|int, mixed> —The authenticated cookie parameters