adding trust_personal_key()
authorVolker Birk <vb@pep-project.org>
Mon, 28 Sep 2015 11:20:04 +0200
changeset 48aad9facc76e6
parent 47 a364a7231af7
child 49 6bb2268f58c3
adding trust_personal_key()
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Mon Sep 14 14:51:57 2015 +0200
     1.2 +++ b/CpEpEngine.cpp	Mon Sep 28 11:20:04 2015 +0200
     1.3 @@ -966,3 +966,29 @@
     1.4      *pVal = (pEp_color) _color;
     1.5      return S_OK;
     1.6  }
     1.7 +
     1.8 +STDMETHODIMP CpEpEngine::trust_personal_key(struct pEp_identity_s *ident)
     1.9 +{
    1.10 +    ::pEp_identity *_ident;
    1.11 +
    1.12 +    assert(ident);
    1.13 +
    1.14 +    try {
    1.15 +        _ident = new_identity(ident);
    1.16 +    }
    1.17 +    catch (bad_alloc&) {
    1.18 +        return E_OUTOFMEMORY;
    1.19 +    }
    1.20 +    catch (exception&) {
    1.21 +        return E_FAIL;
    1.22 +    }
    1.23 +
    1.24 +    PEP_STATUS status = ::trust_personal_key(get_session(), _ident);
    1.25 +    free_identity(_ident);
    1.26 +    if (status == PEP_OUT_OF_MEMORY)
    1.27 +        return E_OUTOFMEMORY;
    1.28 +    else if (status != PEP_STATUS_OK)
    1.29 +        return FAIL(L"failure while executing trust_personal_key()");
    1.30 +
    1.31 +    return S_OK;
    1.32 +}
     2.1 --- a/CpEpEngine.h	Mon Sep 14 14:51:57 2015 +0200
     2.2 +++ b/CpEpEngine.h	Mon Sep 28 11:20:04 2015 +0200
     2.3 @@ -144,7 +144,8 @@
     2.4      STDMETHOD(myself)(struct pEp_identity_s *ident, struct pEp_identity_s *result);
     2.5      STDMETHOD(update_identity)(struct pEp_identity_s *ident, struct pEp_identity_s *result);
     2.6      STDMETHOD(key_compromized)(BSTR fpr);
     2.7 -    
     2.8 +    STDMETHOD(trust_personal_key)(struct pEp_identity_s *ident);
     2.9 +
    2.10      // Message API
    2.11  
    2.12      STDMETHOD(encrypt_message)(text_message * src, text_message * dst, SAFEARRAY * extra);
     3.1 --- a/pEpCOMServerAdapter.idl	Mon Sep 14 14:51:57 2015 +0200
     3.2 +++ b/pEpCOMServerAdapter.idl	Mon Sep 28 11:20:04 2015 +0200
     3.3 @@ -120,6 +120,7 @@
     3.4      HRESULT myself([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
     3.5      HRESULT update_identity([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
     3.6      HRESULT key_compromized([in] BSTR fpr);
     3.7 +    HRESULT trust_personal_key([in] struct pEp_identity_s *ident);
     3.8  
     3.9      // Message API
    3.10