public static function derive(
        string $httpMethod,
        string $uri,
        string $salt,
        DateTime $date,
        $payload = '',
        int $version = 2
    ) : string {
        $httpMethod = \strtoupper($httpMethod);
        $data = self::serializePayload($payload);
        $hash = self::getSignatureHash($data, $salt, $version);
        $time = $date->format(\DateTime::RFC1123);
        $b64Salt = \base64_encode($salt);

        return "{$hash}\n{$httpMethod}+{$uri}\n{$time}\n{$b64Salt}";
    }