public function createSealedJsonRequest(
        string $method,
        string $uri,
        array $arrayToJsonify,
        SealingPublicKey $key,
        array $headers = []
    ): RequestInterface {
        list ($body, $headers) = $this->makeJSON($arrayToJsonify, $headers);
        if (!\is_string($body)) {
            throw new InvalidMessageException('Cannot JSON-encode this message.');
        }
        /** @var array $headers */
        return $this->createSealedRequest(
            $method,
            $uri,
            $body,
            $key,
            $headers
        );
    }
public function createSealedJsonRequest(
        string $method,
        string $uri,
        array $arrayToJsonify,
        SealingPublicKey $key,
        array $headers = []
    ): RequestInterface {
        list ($body, $headers) = $this->makeJSON($arrayToJsonify, $headers);
        if (!\is_string($body)) {
            throw new InvalidMessageException('Cannot JSON-encode this message.');
        }
        /** @var array $headers */
        return $this->createSealedRequest(
            $method,
            $uri,
            $body,
            $key,
            $headers
        );
    }
public function createSealedJsonRequest ( string $ method , string $ uri , array $ arrayToJsonify , SealingPublicKey $ key , array $ headers = [ ] ) : RequestInterface { list ( $ body , $ headers ) = $ this -> makeJSON ( $ arrayToJsonify , $ headers ) ; if ( ! \ is_string ( $ body ) ) { throw new InvalidMessageException ( 'Cannot JSON-encode this message.' ) ; } /** @var array $headers */ return $ this -> createSealedRequest ( $ method , $ uri , $ body , $ key , $ headers ) ; }
Create an HTTP request object with a JSON body that is encrypted
with the server's public key.

@param string $method
@param string $uri
@param array $arrayToJsonify
@param SealingPublicKey $key
@param array $headers
@return RequestInterface
@throws InvalidMessageException
Create an HTTP request object with a JSON body that is encrypted with the server s public key .