diff --git a/src/basic_api.cc b/src/basic_api.cc index e713da0..4195eac 100644 --- a/src/basic_api.cc +++ b/src/basic_api.cc @@ -63,6 +63,17 @@ namespace pEp { else return my_words + partner_words; } + + void trust_personal_key(Identity ident) + { + if (ident.fpr() == "") + throw invalid_argument("fingerprint needed in Identities"); + if (ident.user_id() == "") + throw invalid_argument("user_id must be provided"); + + PEP_STATUS status = trust_personal_key(session, ident); + _throw_status(status); + } } } diff --git a/src/basic_api.hh b/src/basic_api.hh index ca4b33f..efc4a91 100644 --- a/src/basic_api.hh +++ b/src/basic_api.hh @@ -7,6 +7,7 @@ namespace pEp { void update_identity(Identity& ident); void myself(Identity& ident); string _trustwords(Identity me, Identity partner, string lang); + void trust_personal_key(Identity ident); } } diff --git a/src/pEpmodule.cc b/src/pEpmodule.cc index 2e0bb9d..3e37223 100644 --- a/src/pEpmodule.cc +++ b/src/pEpmodule.cc @@ -280,6 +280,11 @@ BOOST_PYTHON_MODULE(pEp) "ensures that the own identity is being complete\n" "supply ident.address and ident.username\n" ); + def("trust_personal_key", &trust_personal_key, + "trust_personal_key(ident)\n" + "\n" + "mark a key as trusted with a person\n" + ); // message API