Expose libresapi for GXS contacts import/export

To import contact
/identity/import_key
{"radix":"AgIRBAAABd..."}

To export contact
/identity/export_key
{"gxs_id":"ffffffffffffffffffffffffffffffff"}

In both cases if everithing went fine the answer is something like
{"data":{"radix":"AgIRBAAABd...", "gxs_id":"fff..."}, "returncode":"ok"}

Some retrocompatible adaptations were necessary to libretroshare

RsGenExchange::deserializeGroupData
p3IdService::deserialiseIdentityFromMemory

Now accept an extra optional pointer parameter to return the id of the
  key so we can return it back from libresapi too and can be used to
  request more information about the key to the API.
This commit is contained in:
Gioacchino Mazzurco 2017-04-19 23:48:25 +02:00
parent 17edf3c8de
commit 5ee517b64f
7 changed files with 184 additions and 74 deletions

View file

@ -305,8 +305,10 @@ public:
virtual bool setAsRegularContact(const RsGxsId& id,bool is_a_contact) = 0 ;
virtual bool isARegularContact(const RsGxsId& id) = 0 ;
virtual bool serialiseIdentityToMemory(const RsGxsId& id,std::string& radix_string)=0;
virtual bool deserialiseIdentityFromMemory(const std::string& radix_string)=0;
virtual bool serialiseIdentityToMemory( const RsGxsId& id,
std::string& radix_string ) = 0;
virtual bool deserialiseIdentityFromMemory( const std::string& radix_string,
RsGxsId* id = nullptr ) = 0;
/*!
* \brief overallReputationLevel