Browse Source

Add feature export_secret_key(Identity)

sync
heck 2 years ago
parent
commit
42a59cbd01
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

@ -130,6 +130,17 @@ namespace pEp {
return key_data;
}
string export_secret_key(Identity ident)
{
PEP_STATUS status = PEP_STATUS_OK;
char* key_data = NULL;
size_t size;
status = ::export_secret_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

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

+ 6
- 0
src/pEpmodule.cc View File

@ -451,6 +451,12 @@ BOOST_PYTHON_MODULE(pEp)
"export key(s) of identity\n"
);
def("export_secret_key", &pEp::PythonAdapter::export_secret_key,
"key_data = export_seret_key(identity)\n"
"\n"
"export secret key(s) of identity\n"
);
def("set_own_key", &pEp::PythonAdapter::set_own_key,
"set_own_key(me, fpr)\n"
"\n"


Loading…
Cancel
Save