Browse Source

Added feature export_key(Identity)

sync
heck 2 years ago
parent
commit
f9b7d61d79
3 changed files with 18 additions and 0 deletions
  1. +11
    -0
      src/basic_api.cc
  2. +1
    -0
      src/basic_api.hh
  3. +6
    -0
      src/pEpmodule.cc

+ 11
- 0
src/basic_api.cc View File

@ -119,6 +119,17 @@ namespace pEp {
return result;
}
string export_key(Identity ident)
{
PEP_STATUS status = PEP_STATUS_OK;
char* key_data = NULL;
size_t size;
status = ::export_key(adapter.session(), ident.fpr().c_str(), &key_data, &size);
_throw_status(status);
return key_data;
}
void set_own_key(Identity& ident, string fpr)
{
if (ident.address() == "")


+ 1
- 0
src/basic_api.hh View File

@ -18,6 +18,7 @@ namespace pEp {
void key_reset_trust(Identity ident);
boost::python::list import_key(string key_data);
string export_key(Identity ident);
void set_own_key(Identity& ident, string fpr);
}
}

+ 6
- 0
src/pEpmodule.cc View File

@ -445,6 +445,12 @@ BOOST_PYTHON_MODULE(pEp)
"import key(s) from key_data\n"
);
def("export_key", &pEp::PythonAdapter::export_key,
"key_data = export_key(identity)\n"
"\n"
"export key(s) of identity\n"
);
def("set_own_key", &pEp::PythonAdapter::set_own_key,
"set_own_key(me, fpr)\n"
"\n"


Loading…
Cancel
Save