diff --git a/src/basic_api.cc b/src/basic_api.cc index 527f256..46ef3d8 100644 --- a/src/basic_api.cc +++ b/src/basic_api.cc @@ -82,6 +82,18 @@ namespace pEp { PEP_STATUS status = unset_identity_flags(adapter.session(), ident, flags); _throw_status(status); } + + void key_reset_trust(Identity ident) { + if (ident.fpr() == "") + throw invalid_argument("address needed"); + if (ident.address() == "") + throw invalid_argument("address needed"); + if (ident.user_id() == "") + throw invalid_argument("address needed"); + + PEP_STATUS status = key_reset_trust(adapter.session(), ident); + _throw_status(status); + } } } diff --git a/src/basic_api.hh b/src/basic_api.hh index 332755d..e5281b7 100644 --- a/src/basic_api.hh +++ b/src/basic_api.hh @@ -5,6 +5,10 @@ #include "pEpmodule.hh" +DYNAMIC_API PEP_STATUS key_reset_trust( + PEP_SESSION session, + pEp_identity *ident + ); namespace pEp { namespace PythonAdapter { void update_identity(Identity& ident); @@ -14,6 +18,8 @@ namespace pEp { void set_identity_flags(Identity ident, identity_flags_t flags); void unset_identity_flags(Identity ident, identity_flags_t flags); + + void key_reset_trust(Identity ident); } } diff --git a/src/pEpmodule.cc b/src/pEpmodule.cc index a468514..62bf1f8 100644 --- a/src/pEpmodule.cc +++ b/src/pEpmodule.cc @@ -322,6 +322,13 @@ BOOST_PYTHON_MODULE(pEp) "unset identity flags\n" ); + def("key_reset_trust", &pEp::PythonAdapter::key_reset_trust, + "key_reset_trust(ident)\n" + "\n" + "reset trust bit or explicitly mistrusted status for an identity and " + "its accompanying key/user_id pair\n" + ); + // message API enum_("PEP_rating")