|
|
@ -96,6 +96,8 @@ namespace pEp { |
|
|
|
_throw_status(status); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boost::python::list import_key(string key_data) |
|
|
|
{ |
|
|
|
::identity_list *private_keys = NULL; |
|
|
@ -116,6 +118,22 @@ namespace pEp { |
|
|
|
free_identity_list(private_keys); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
void set_own_key(Identity& ident, string fpr) |
|
|
|
{ |
|
|
|
if (ident.address() == "") |
|
|
|
throw invalid_argument("address needed"); |
|
|
|
if (ident.username() == "") |
|
|
|
throw invalid_argument("username needed"); |
|
|
|
if (ident.user_id() == "") |
|
|
|
throw invalid_argument("user_id needed"); |
|
|
|
if (fpr == "") |
|
|
|
throw invalid_argument("fpr needed"); |
|
|
|
|
|
|
|
|
|
|
|
const char* fpr_c = fpr.c_str(); |
|
|
|
PEP_STATUS status = set_own_key(adapter.session(), ident, fpr_c); |
|
|
|
_throw_status(status); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|