src/message_api.h
author vb
Wed, 11 Mar 2015 12:27:09 +0100
changeset 102 f75794bc7259
parent 101 d90b10cb193d
child 113 4bee48270834
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 
    33 DYNAMIC_API PEP_STATUS encrypt_message(
    34         PEP_SESSION session,
    35         const message *src,
    36         stringlist_t *extra,
    37         message **dst,
    38         PEP_enc_format enc_format
    39     );
    40 
    41 
    42 // decrypt_message() - decrypt message in memory
    43 //
    44 //  parameters:
    45 //      session (in)        session handle
    46 //      src (in)            message to decrypt
    47 //      dst (out)           pointer to new decrypted message or NULL on failure
    48 //      enc_format (in)     unencrypted format
    49 //
    50 //  return value:
    51 //      error status or PEP_STATUS_OK on success
    52 //
    53 //	caveat:
    54 //	    the ownership of the new message goes to the caller
    55 
    56 DYNAMIC_API PEP_STATUS decrypt_message(
    57         PEP_SESSION session,
    58         const message *src,
    59         message **dst,
    60         PEP_enc_format enc_format
    61     );
    62 
    63 #ifdef __cplusplus
    64 }
    65 #endif
    66