public function getAuthorizationHeader()
    {
        if (empty($this->realm) || empty($this->id) || empty($this->nonce) || empty($this->version)) {
            throw new MalformedRequestException(
                'One or more required authorization header fields (ID, nonce, realm, version) are missing.',
                null,
                0,
                $this->request
            );
        }

        $signature = !empty($this->signature) ? $this->signature : $this->generateSignature();

        return new AuthorizationHeader(
            $this->realm,
            $this->id,
            $this->nonce,
            $this->version,
            $this->headers,
            $signature
        );
    }