Apple_Push_API\Request\Request::sign PHP Méthode

sign() private méthode

Signs the API request.
Since: 0.2.0
private sign ( string $url, string $verb, string $content = null ) : array
$url string
$verb string
$content string
Résultat array
    private function sign($url, $verb, $content = null)
    {
        $current_date = date('c');
        $request_info = $verb . $url . $current_date;
        if ('POST' == $verb) {
            $content_type = 'multipart/form-data; boundary=' . $this->mime_builder->boundary();
            $request_info .= $content_type . $content;
        }
        $secret_key = base64_decode($this->credentials->secret());
        $hash = hash_hmac('sha256', $request_info, $secret_key, true);
        $signature = base64_encode($hash);
        return 'HHMAC; key=' . $this->credentials->key() . '; signature=' . $signature . '; date=' . $current_date;
    }