src/message_api.h
author vb
Sun, 15 Mar 2015 21:07:12 +0100
changeset 117 d2ff99ccdf30
parent 113 4bee48270834
child 189 dc89296e774b
permissions -rw-r--r--
...
     1 #pragma once
     2 
     3 #include "pEpEngine.h"
     4 #include "keymanagement.h"
     5 #include "message.h"
     6 #include "mime.h"
     7 
     8 #ifdef __cplusplus
     9 extern "C" {
    10 #endif
    11 
    12 
    13 // encrypt_message() - encrypt message in memory
    14 //
    15 //  parameters:
    16 //      session (in)        session handle
    17 //      src (in)            message to encrypt
    18 //      extra (in)          extra keys for encryption
    19 //      dst (out)           pointer to new encrypted message or NULL on failure
    20 //      enc_format (in)     encrypted format
    21 //
    22 //  return value:
    23 //      PEP_STATUS_OK                   on success
    24 //		PEP_KEY_NOT_FOUND	            at least one of the receipient keys
    25 //		                                could not be found
    26 //		PEP_KEY_HAS_AMBIG_NAME          at least one of the receipient keys has
    27 //		                                an ambiguous name
    28 //		PEP_GET_KEY_FAILED		        cannot retrieve key
    29 //
    30 //	caveat:
    31 //	    the ownership of the new message goes to the caller
    32 //	    if src is unencrypted this function returns PEP_UNENCRYPTED and sets
    33 //	    dst to NULL
    34 
    35 DYNAMIC_API PEP_STATUS encrypt_message(
    36         PEP_SESSION session,
    37         message *src,
    38         stringlist_t *extra,
    39         message **dst,
    40         PEP_enc_format enc_format
    41     );
    42 
    43 
    44 // decrypt_message() - decrypt message in memory
    45 //
    46 //  parameters:
    47 //      session (in)        session handle
    48 //      src (in)            message to decrypt
    49 //      mime (in)           MIME encoding wanted
    50 //      dst (out)           pointer to new decrypted message or NULL on failure
    51 //
    52 //  return value:
    53 //      error status or PEP_STATUS_OK on success
    54 //
    55 //	caveat:
    56 //	    the ownership of the new message goes to the caller
    57 
    58 DYNAMIC_API PEP_STATUS decrypt_message(
    59         PEP_SESSION session,
    60         message *src,
    61         PEP_MIME_format mime,
    62         message **dst
    63     );
    64 
    65 #ifdef __cplusplus
    66 }
    67 #endif
    68