Browse Source

adding trust_personal_key()

doc_update_sequoia
Volker Birk 7 years ago
parent
commit
8497834daa
2 changed files with 43 additions and 0 deletions
  1. +28
    -0
      src/keymanagement.c
  2. +15
    -0
      src/keymanagement.h

+ 28
- 0
src/keymanagement.c View File

@ -332,3 +332,31 @@ DYNAMIC_API PEP_STATUS key_compromized(PEP_SESSION session, const char *fpr)
return status;
}
DYNAMIC_API PEP_STATUS trust_personal_key(
PEP_SESSION session,
pEp_identity *ident
)
{
PEP_STATUS status = PEP_STATUS_OK;
assert(session);
assert(ident);
assert(!EMPTY(ident->address));
assert(!EMPTY(ident->user_id));
assert(!EMPTY(ident->fpr));
assert(!ident->me);
if (!ident || EMPTY(ident->address) || EMPTY(ident->user_id) ||
EMPTY(ident->fpr) || ident->me)
return PEP_ILLEGAL_VALUE;
status = update_identity(session, ident);
if (status != PEP_STATUS_OK)
return status;
ident->comm_type |= PEP_ct_confirmed;
status = update_identity(session, ident);
return status;
}

+ 15
- 0
src/keymanagement.h View File

@ -122,6 +122,21 @@ DYNAMIC_API PEP_STATUS do_keymanagement(
DYNAMIC_API PEP_STATUS key_compromized(PEP_SESSION session, const char *fpr);
// trust_personal_key() - mark a key as trusted with a person
//
// parameters:
// session (in) session to use
// ident (in) person and key to trust in
//
// caveat:
// the fields user_id, address and fpr must be supplied
DYNAMIC_API PEP_STATUS trust_personal_key(
PEP_SESSION session,
pEp_identity *ident
);
#ifdef __cplusplus
}
#endif


Loading…
Cancel
Save