public function createSymmetricEncryptedJsonResponse(
        int $status,
        array $arrayToJsonify,
        SharedEncryptionKey $key,
        array $headers = [],
        string $version = '1.1'
    ): ResponseInterface {
        list ($body, $headers) = $this->makeJSON($arrayToJsonify, $headers);
        if (!\is_string($body)) {
            throw new InvalidMessageException('Cannot JSON-encode this message.');
        }
        /** @var array $headers */
        return $this->createSymmetricEncryptedResponse(
            $status,
            $body,
            $key,
            $headers,
            $version
        );
    }
public function createSymmetricEncryptedJsonResponse(
        int $status,
        array $arrayToJsonify,
        SharedEncryptionKey $key,
        array $headers = [],
        string $version = '1.1'
    ): ResponseInterface {
        list ($body, $headers) = $this->makeJSON($arrayToJsonify, $headers);
        if (!\is_string($body)) {
            throw new InvalidMessageException('Cannot JSON-encode this message.');
        }
        /** @var array $headers */
        return $this->createSymmetricEncryptedResponse(
            $status,
            $body,
            $key,
            $headers,
            $version
        );
    }
public function createSymmetricEncryptedJsonResponse ( int $ status , array $ arrayToJsonify , SharedEncryptionKey $ key , array $ headers = [ ] , string $ version = '1.1' ) : ResponseInterface { list ( $ body , $ headers ) = $ this -> makeJSON ( $ arrayToJsonify , $ headers ) ; if ( ! \ is_string ( $ body ) ) { throw new InvalidMessageException ( 'Cannot JSON-encode this message.' ) ; } /** @var array $headers */ return $ this -> createSymmetricEncryptedResponse ( $ status , $ body , $ key , $ headers , $ version ) ; }
Create an HTTP response object with a JSON body that is encrypted
with a pre-shared key.

@param int $status
@param array $arrayToJsonify
@param SharedEncryptionKey $key
@param array $headers
@param string $version
@return ResponseInterface
@throws InvalidMessageException
Create an HTTP response object with a JSON body that is encrypted with a pre - shared key .