public static function signRequest(
        AbstractRequestHandler $requestHandler,
        $endpoint,
        $httpMethod,
        Payload $payload = null
    ) {
        $endPointPath = self::generateEndPointPath($endpoint, $requestHandler->getSDKId());

        $messageToSign = "{$httpMethod}&$endPointPath";
        if ($payload instanceof Payload) {
            $messageToSign .= "&{$payload->getBase64Payload()}";
        }

        openssl_sign($messageToSign, $signedMessage, $requestHandler->getPem(), OPENSSL_ALGO_SHA256);

        self::validateSignedMessage($signedMessage);

        $base64SignedMessage = base64_encode($signedMessage);

        return [
            self::SIGNED_MESSAGE_KEY => $base64SignedMessage,
            self::END_POINT_PATH_KEY => $endPointPath
        ];
    }
public static function signRequest(
        AbstractRequestHandler $requestHandler,
        $endpoint,
        $httpMethod,
        Payload $payload = null
    ) {
        $endPointPath = self::generateEndPointPath($endpoint, $requestHandler->getSDKId());

        $messageToSign = "{$httpMethod}&$endPointPath";
        if ($payload instanceof Payload) {
            $messageToSign .= "&{$payload->getBase64Payload()}";
        }

        openssl_sign($messageToSign, $signedMessage, $requestHandler->getPem(), OPENSSL_ALGO_SHA256);

        self::validateSignedMessage($signedMessage);

        $base64SignedMessage = base64_encode($signedMessage);

        return [
            self::SIGNED_MESSAGE_KEY => $base64SignedMessage,
            self::END_POINT_PATH_KEY => $endPointPath
        ];
    }
public static function signRequest ( AbstractRequestHandler $ requestHandler , $ endpoint , $ httpMethod , Payload $ payload = null ) { $ endPointPath = self :: generateEndPointPath ( $ endpoint , $ requestHandler -> getSDKId ( ) ) ; $ messageToSign = "{$httpMethod}&$endPointPath" ; if ( $ payload instanceof Payload ) { $ messageToSign .= "&{$payload->getBase64Payload()}" ; } openssl_sign ( $ messageToSign , $ signedMessage , $ requestHandler -> getPem ( ) , OPENSSL_ALGO_SHA256 ) ; self :: validateSignedMessage ( $ signedMessage ) ; $ base64SignedMessage = base64_encode ( $ signedMessage ) ; return [ self :: SIGNED_MESSAGE_KEY => $ base64SignedMessage , self :: END_POINT_PATH_KEY => $ endPointPath ] ; }
Return request signed data.

@param AbstractRequestHandler $requestHandler
@param string $endpoint
@param string $httpMethod
@param Payload|NULL $payload

@return array

@throws RequestException
Return request signed data .