public function createSignature(array &$request_data)
    {
        // Make a nonce
        $request_data['cnonce'] = $this->createNonce();

        // Get the data to be signed.
        $data_to_sign = http_build_query($request_data);

        // Create the base64 encoded copy of the signature.
        $base64_signature = $this->key->sign($data_to_sign);
        if (! empty($base64_signature)) {
            $request_data['sig'] = $base64_signature;
        }

        return $base64_signature;
    }
public function createSignature(array &$request_data)
    {
        // Make a nonce
        $request_data['cnonce'] = $this->createNonce();

        // Get the data to be signed.
        $data_to_sign = http_build_query($request_data);

        // Create the base64 encoded copy of the signature.
        $base64_signature = $this->key->sign($data_to_sign);
        if (! empty($base64_signature)) {
            $request_data['sig'] = $base64_signature;
        }

        return $base64_signature;
    }
public function createSignature ( array & $ request_data ) { // Make a nonce $ request_data [ 'cnonce' ] = $ this -> createNonce ( ) ; // Get the data to be signed. $ data_to_sign = http_build_query ( $ request_data ) ; // Create the base64 encoded copy of the signature. $ base64_signature = $ this -> key -> sign ( $ data_to_sign ) ; if ( ! empty ( $ base64_signature ) ) { $ request_data [ 'sig' ] = $ base64_signature ; } return $ base64_signature ; }
Construct a request signature, or return null if there is none.

Creating a signature requires knowledge of the client's private key.  The client
can send the signature to the server without the server having knowledge of the
client's private key.  The server only needs to know the public key that relates
to the private key.  See the KeyPair class for generating public/private key pairs.

A client generated nonce is also created and added to the request data.  This
*should* (but does not have to be) checked and verified on the server.  The nonce
is used to ensure that no two requests have the same data even if the endpoint
and request data are the same.

The request data *should* (but does not have to) contain a server generated nonce.
The server generated nonce should be used exactly once -- generated on the server,
used by the client and then discarded.

Adds the following array entities to $request_data:

* cnonce -- the client generated nonce
* sig -- the signature, signed with the private made by setPrivateKey

Returns the signature, or null if there was no signature.

@param array $request_data

@return string|null
Construct a request signature or return null if there is none .