src/message_api.h
author vb
Tue, 03 Mar 2015 11:02:26 +0100
changeset 83 c5d82f11689a
parent 81 044ce1c7fc9c
child 84 2009f3090d32
permissions -rw-r--r--
...
     1 #pragma once
     2 
     3 #ifdef __cplusplus
     4 extern "C" {
     5 #endif
     6 
     7 #include "transport.h"
     8 
     9 
    10 // encrypt_message() - encrypt message in memory
    11 //
    12 //  parameters:
    13 //      session (in)        session handle
    14 //      src (in)            message to encrypt
    15 //      extra (in)          extra keys for encryption
    16 //      dst (out)           pointer to new encrypted message or NULL on failure
    17 //      format (in)         encrypted format
    18 //
    19 //  return value:
    20 //      PEP_STATUS_OK                   on success
    21 //		PEP_KEY_NOT_FOUND	            at least one of the receipient keys
    22 //		                                could not be found
    23 //		PEP_KEY_HAS_AMBIG_NAME          at least one of the receipient keys has
    24 //		                                an ambiguous name
    25 //		PEP_GET_KEY_FAILED		        cannot retrieve key
    26 //
    27 //	caveat:
    28 //	    the ownership of the new message goes to the caller
    29 
    30 DYNAMIC_API PEP_STATUS encrypt_message(
    31         PEP_SESSION session,
    32         const message *src,
    33         stringlist_t *extra,
    34         message **dst,
    35         PEP_enc_format enc_format
    36     );
    37 
    38 
    39 // decrypt_message() - decrypt message in memory
    40 //
    41 //  parameters:
    42 //      session (in)        session handle
    43 //      src (in)            message to decrypt
    44 //      dst (out)           pointer to new decrypted message or NULL on failure
    45 //      format (in)         unencrypted format
    46 //
    47 //  return value:
    48 //      error status or PEP_STATUS_OK on success
    49 //
    50 //	caveat:
    51 //	    the ownership of the new message goes to the caller
    52 
    53 DYNAMIC_API PEP_STATUS decrypt_message(
    54         PEP_SESSION session,
    55         const message *src,
    56         message **dst,
    57         PEP_enc_format enc_format
    58     );
    59 
    60 #ifdef __cplusplus
    61 }
    62 #endif
    63