UriSigner

class UriSigner

Signs URIs.

Methods

__construct(string $secret)

Constructor.

string sign(string $uri)

Signs a URI.

bool check(string $uri)

Checks that a URI contains the correct hash.

Details

__construct(string $secret)

Constructor.

Parameters

string $secret A secret

string sign(string $uri)

Signs a URI.

The given URI is signed by adding a _hash query string parameter which value depends on the URI and the secret.

Parameters

string $uri A URI to sign

Return Value

string The signed URI

bool check(string $uri)

Checks that a URI contains the correct hash.

The _hash query string parameter must be the last one (as it is generated that way by the sign() method, it should never be a problem).

Parameters

string $uri A signed URI

Return Value

bool True if the URI is signed correctly, false otherwise
doc_Symfony
2016-10-28 06:36:02
Comments
Leave a Comment

Please login to continue.