class RestfulEnclaveClient implements EnclaveClient {

    @Override
    public RawTransaction encryptRawPayload(byte[] message, PublicKey sender) {

        return ClientCallback.execute(
                () -> {
                    EnclavePayload enclavePayload = new EnclavePayload();
                    enclavePayload.setData(message);
                    enclavePayload.setSenderKey(sender.getKeyBytes());

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

                    validateResponseIsOk(response);

                    EnclaveRawPayload enclaveRawPayload = response.readEntity(EnclaveRawPayload.class);

                    byte[] encryptedPayload = enclaveRawPayload.getEncryptedPayload();
                    byte[] encryptedKey = enclaveRawPayload.getEncryptedKey();
                    Nonce nonce = new Nonce(enclaveRawPayload.getNonce());
                    PublicKey senderKey = PublicKey.from(enclaveRawPayload.getFrom());
                    return new RawTransaction(encryptedPayload, encryptedKey, nonce, senderKey);
                });
    }

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

}