src/message_api.h
branchkrista_local_windows
changeset 1125 89e75396c69a
parent 736 496905895282
child 1126 129b561095a6
     1.1 --- a/src/message_api.h	Tue Aug 02 12:55:50 2016 +0200
     1.2 +++ b/src/message_api.h	Wed Aug 31 17:26:59 2016 +0200
     1.3 @@ -47,6 +47,38 @@
     1.4          PEP_enc_format enc_format
     1.5      );
     1.6  
     1.7 +// encrypt_message_for_self() - encrypt message in memory for user's identity only,
     1.8 +//                              ignoring recipients and other identities from
     1.9 +//                              the message
    1.10 +//  parameters:
    1.11 +//      session (in)        session handle
    1.12 +//      target_id (in)      self identity this message should be encrypted for
    1.13 +//      src (in)            message to encrypt
    1.14 +//      dst (out)           pointer to new encrypted message or NULL on failure
    1.15 +//      enc_format (in)     encrypted format
    1.16 +//
    1.17 +//  return value:       (FIXME: This may not be correct or complete)
    1.18 +//      PEP_STATUS_OK                   on success
    1.19 +//		PEP_KEY_NOT_FOUND	            at least one of the receipient keys
    1.20 +//		                                could not be found
    1.21 +//		PEP_KEY_HAS_AMBIG_NAME          at least one of the receipient keys has
    1.22 +//		                                an ambiguous name
    1.23 +//		PEP_GET_KEY_FAILED		        cannot retrieve key
    1.24 +//
    1.25 +//	caveat:
    1.26 +//	    the ownership of src remains with the caller
    1.27 +//      the ownership of target_id remains w/ caller            
    1.28 +//	    the ownership of dst goes to the caller
    1.29 +//      message is NOT encrypted for identities other than the target_id (and then,
    1.30 +//          only if the target_id refers to self!)
    1.31 +
    1.32 +DYNAMIC_API PEP_STATUS encrypt_message_for_self(
    1.33 +        PEP_SESSION session,
    1.34 +        pEp_identity* target_id,
    1.35 +        message *src,
    1.36 +        message **dst,
    1.37 +        PEP_enc_format enc_format
    1.38 +    );
    1.39  
    1.40  typedef enum _PEP_color {
    1.41      PEP_rating_undefined = 0,