class RestfulEnclaveClient implements EnclaveClient {

    @Override
    public EncodedPayload encryptPayload(
            byte[] message, PublicKey senderPublicKey, List<PublicKey> recipientPublicKeys) {

        return ClientCallback.execute(
                () -> {
                    EnclavePayload enclavePayload = new EnclavePayload();
                    enclavePayload.setData(message);
                    enclavePayload.setSenderKey(senderPublicKey.getKeyBytes());
                    enclavePayload.setRecipientPublicKeys(
                            recipientPublicKeys.stream().map(PublicKey::getKeyBytes).collect(Collectors.toList()));

                    Response response = client.target(uri).path("encrypt").request().post(Entity.json(enclavePayload));

                    validateResponseIsOk(response);

                    byte[] result = response.readEntity(byte[].class);

                    return PayloadEncoder.create().decode(result);
                });
    }

    public  RestfulEnclaveClient(Client client, URI uri);
    public  RestfulEnclaveClient(Client client, URI uri, ExecutorService executorService);

}