src/message_api.h
branchENGINE-180
changeset 1641 1c9358f42ce0
parent 1640 52e90165ad0f
child 1644 6b88877f8885
     1.1 --- a/src/message_api.h	Fri Mar 10 17:53:48 2017 +0100
     1.2 +++ b/src/message_api.h	Mon Mar 13 08:43:04 2017 +0100
     1.3 @@ -135,6 +135,44 @@
     1.4      PEP_encrypt_flags_t flags
     1.5  );
     1.6  
     1.7 +// MIME_encrypt_message_for_self() - encrypt MIME message for user's identity only,
     1.8 +//                              ignoring recipients and other identities from
     1.9 +//                              the message, with MIME output
    1.10 +//  parameters:
    1.11 +//      session (in)            session handle
    1.12 +//      mimetext (in)           MIME encoded text to encrypt
    1.13 +//      size (in)               size of input mime text
    1.14 +//      extra (in)              extra keys for encryption
    1.15 +//      mime_ciphertext (out)   encrypted, encoded message
    1.16 +//      enc_format (in)         encrypted format
    1.17 +//      flags (in)              flags to set special encryption features
    1.18 +//
    1.19 +//  return value:
    1.20 +//      PEP_STATUS_OK           if everything worked
    1.21 +//      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
    1.22 +//      PEP_CANNOT_CREATE_TEMP_FILE
    1.23 +//                              if there are issues with temp files; in
    1.24 +//                              this case errno will contain the underlying
    1.25 +//                              error
    1.26 +//      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
    1.27 +//
    1.28 +//  caveat:
    1.29 +//      the encrypted, encoded mime text will go to the ownership of the caller; mimetext
    1.30 +//      will remain in the ownership of the caller
    1.31 +
    1.32 +DYNAMIC_API PEP_STATUS MIME_encrypt_message_for_self(
    1.33 +    PEP_SESSION session,
    1.34 +    pEp_identity* target_id,
    1.35 +    const char *mimetext,
    1.36 +    size_t size,
    1.37 +    stringlist_t* extra,
    1.38 +    char** mime_ciphertext,
    1.39 +    PEP_enc_format enc_format,
    1.40 +    PEP_encrypt_flags_t flags
    1.41 +);
    1.42 +
    1.43 +
    1.44 +
    1.45  typedef enum _PEP_rating {
    1.46      PEP_rating_undefined = 0,
    1.47      PEP_rating_cannot_decrypt,