SproutCMS

This is the code documentation for the SproutCMS project

function serverKeySign()

Generate a signature from a given set of fields, using the server key

For a given set of fields, the signature will always be the same value.
Returned signatures are always URL and HTML safe

Usage

string Security::serverKeySign ( array $fields );

Example

// In method which creates link to resource/download
$sig = Security::serverKeySign(['id' => $id]);
$file_url = "resource/download?id={$id}&sig={$sig}";

Arguments

  1. array $fields
    Key-value fields making up the data to sign

Return value

  • string
    Signature of the data, always url safe