class RestfulEnclaveClient implements EnclaveClient {

    @Override
    public byte[] unencryptTransaction(EncodedPayload payload, PublicKey providedKey) {

        return ClientCallback.execute(
                () -> {
                    EnclaveUnencryptPayload dto = new EnclaveUnencryptPayload();

                    byte[] body = PayloadEncoder.create().encode(payload);

                    dto.setData(body);

                    if (providedKey != null) {
                        dto.setProvidedKey(providedKey.getKeyBytes());
                    }
                    Response response = client.target(uri).path("unencrypt").request().post(Entity.json(dto));

                    validateResponseIsOk(response);

                    return response.readEntity(byte[].class);
                });
    }

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

}