src/message_api.h
author vb
Sat, 03 Jan 2015 16:37:53 +0100
changeset 44 4013b57a6a69
parent 39 66b5cc6cb987
child 48 9ff5d2dfa75a
permissions -rw-r--r--
...
     1 #pragma once
     2 
     3 #ifdef __cplusplus
     4 extern "C" {
     5 #endif
     6 
     7 #include "transport.h"
     8 
     9 
    10 // mime_encode_parts() - encode message with MIME
    11 //  parameters:
    12 //      src                 message to encode
    13 //      dst                 encoded message or NULL on error
    14 //
    15 //  return value:
    16 //      error status or PEP_STATUS_OK on success
    17 //
    18 //  caveat:
    19 //      message must be unencrypted
    20 
    21 DYNAMIC_API PEP_STATUS mime_encode_parts(const message *src, message **dst);
    22 
    23 
    24 // mime_decode_parts() - decode MIME message
    25 //  parameters:
    26 //      src                 message to decode
    27 //      dst                 decoded message or NULL on error
    28 //
    29 //  return value:
    30 //      error status or PEP_STATUS_OK on success
    31 //
    32 //  caveat:
    33 //      message must be unencrypted
    34 
    35 DYNAMIC_API PEP_STATUS mime_decode_parts(const message *src, message **dst);
    36 
    37 
    38 // encrypt_message() - encrypt message in memory
    39 //
    40 //  parameters:
    41 //      session             session handle
    42 //      src                 message to encrypt
    43 //      extra               extra keys for encryption
    44 //      dst                 pointer to encrypted message or NULL on failure
    45 //      format              encryption format
    46 //
    47 //  return value:
    48 //      error status or PEP_STATUS_OK on success; PEP_KEY_NOT_FOUND if one
    49 //      or more keys couldn't be found, but the message could be encrypted
    50 //      with other keys
    51 
    52 DYNAMIC_API PEP_STATUS encrypt_message(
    53         PEP_SESSION session,
    54         const message *src,
    55         stringlist_t *extra,
    56         message **dst,
    57         PEP_enc_format format
    58     );
    59 
    60 
    61 // decrypt_message() - decrypt message in memory
    62 //
    63 //  parameters:
    64 //      session             session handle
    65 //      src                 message to decrypt
    66 //      dst                 pointer to decrypted message or NULL on failure
    67 //
    68 //  return value:
    69 //      error status or PEP_STATUS_OK on success
    70 
    71 DYNAMIC_API PEP_STATUS decrypt_message(
    72         PEP_SESSION session,
    73         const message *src,
    74         message **dst
    75     );
    76 
    77 #ifdef __cplusplus
    78 }
    79 #endif
    80